<img src="images/Story/menu.png" width=80%>
<i><h3>
The following game is a work of fiction. Destined to Ascend is a game with a lot of erotic content.
Are you over legal age and friendly with the content of that game?</h3></i>
<<link "Yes" "Opening and Name">><<set $knownRecipes.push($strengthboostrecipe1)>><<set $difficulty to null>><</link>>
<a href="https://www.google.com/">No</a>
<<nobr>>
<<set $skillInventory.push($soulflareReversal)>>
<<set $skillInventory.push($stoneheartConstitution)>>
<<set $skillInventory.push($heavenSplittingPalm)>>
<</nobr>><div class="main-menu-container">
<h2 class="main-title">Path of Ascension</h2>
<div class="progress-hint">
<h3 style="margin-bottom:6px;">Current Objective</h3>
<<switch $mainStage>>
<<case 0>>
<b>Seek your destiny.</b>
<p>
Explore the Mortal Realm.<br>
Strange places and random encounters may hide opportunities that ordinary cultivators overlook.
</p>
<<case 1>>
<b>Investigate the Phoenix inheritance.</b>
<p>
The Phoenix Sigil now resides within your soul.<br>
Continue exploring the map. Story events may now appear while travelling.
</p>
<<case 2>>
<b>Continue your journey.</b>
<p>
Travel across the region.<br>
Visit hunting grounds, gather herbs and keep exploring.<br>
Someone carrying dangerous knowledge is waiting to cross your path.
</p>
<<case 2.5>>
<b>Travel to Northern Phoenix City.</b>
<p>
The Regional Martial Tournament is about to begin.<br>
Register as a participant and prepare for the competition.
</p>
<<case 3>>
<b>Leave Northern Phoenix City.</b>
<p>
Shen Tian's ascension has raised many questions.<br>
Continue exploring the world. Your next encounter will not be a coincidence.
</p>
<<case 4>>
<b>Follow the Phoenix Sigil.</b>
<p>
You have drawn Heaven's attention.<br>
Keep travelling across the map.<br>
The Phoenix Sigil will eventually react to something hidden.
</p>
<<case 5>>
<b>Prepare to leave the Mortal Realm.</b>
<p>
Complete the remaining main mission.<br>
Strengthen yourself before venturing into the next region.
</p>
<<default>>
<b>Forge your own destiny.</b>
<p>
Your journey continues beyond the Mortal Realm.<br>
Seek powerful allies, establish your own sect and uncover the truth behind Heaven.
</p>
<</switch>>
<hr>
<h3 style="margin-bottom:6px;">Guidance</h3>
<<if $CurrentPcAffiliation is "">>
<p>
You are currently an <b>independent cultivator</b>.
</p>
<p>
Joining a sect is <b>optional</b>.<br>
You may complete Region 1 entirely as a wandering cultivator.
</p>
<p>
If you choose to remain independent:
</p>
<ul style="padding-left:18px;">
<li>Explore frequently.</li>
<li>Complete random encounters.</li>
<li>Hunt demonic beasts.</li>
<li>Gather spiritual herbs.</li>
<li>Earn your reputation through actions.</li>
</ul>
<<else>>
<p>
Current Affiliation:
<b><<print $CurrentPcAffiliation>></b>
</p>
<p>
Remember that your choices may influence how your sect views you.
</p>
<</if>>
<hr>
<h3 style="margin-bottom:6px;">General Tips</h3>
<ul style="padding-left:18px;">
<li>Moving across the map may trigger random events.</li>
<li>Main story events often require exploration rather than waiting.</li>
<li>Hunting Grounds provide experience, spirit stones and useful crafting materials.</li>
<li>Gathering herbs can reveal hidden encounters or rare ingredients.</li>
<li>Towns and cities contain merchants, quests and important NPCs.</li>
<li>Many story choices affect reputation and future dialogue.</li>
<li>Some encounters only appear after advancing the main story.</li>
<li>Returning to previously visited locations may unlock new events.</li>
</ul>
<hr>
<h3 style="margin-bottom:6px;">Journal</h3>
<<if $mainStage lt 3>>
<p>
<i>You still know very little about the world.<br>
Continue your journey and uncover its secrets.</i>
</p>
<<elseif $mainStage gte 3 and $mainStage lt 5>>
<p>
<i>You have begun questioning everything you once believed about Heaven.<br>
Every answer seems to reveal even greater mysteries.</i>
</p>
<<else>>
<p>
<i>The truth is far more complicated than you imagined.<br>
Both Heaven and those who opposed it seem to be hiding something.</i>
</p>
<</if>>
</div>
<<if $corruption >= $equippedRobe.corruptionLock and $corruption >= $equippedUnderwear.corruptionLock>>
<br>
<<link "Go back" $passage>><</link>>
<<else>>
<br>
<i>I should probably put some clothes on...</i>
<</if>>
</div><<nobr>>
<<if $pe eq 0>>
<br><img src="images/Story/intro.jpg" class=center width="60%">
<<run Dialog.setup("Movement & Skills")>>
<<run Dialog.wiki("You can move around the map using <b>WASD</b> keys.<br><br> Before engaging in battles, make sure to equip your skills! After you finish the prologue, open the <b>Skills</b> tab (bottom of the screen) to prepare your abilities.")>>
<<run Dialog.open()>>
<br>The wind howled like a crying ghost as dusk fell over the broken ridges of Mount Yunsu. You had come here chasing whispers—rumors of spirit beasts and hidden herbs—but found something far beyond the mundane.
<br>
<br>From behind a cluster of jagged boulders, you watched in awe and terror as two figures clashed mid-air—one cloaked in black flame, the other wrapped in blinding golden radiance. Swords hummed with killing intent, Qi tore through the sky, and even the clouds trembled. A battle between cultivators of opposing sects: one clearly righteous, the other reeking of demonic aura.
<br>
<br>As the duel reached its climax, the heavens themselves roared.
<br>
<br>Suddenly, the sky darkened. Black thunderclouds surged, lightning coiling like serpents. A blinding pillar of light struck between them, forcing both to crash to the earth. And from that split in the heavens… something impossible emerged.
<br>
<br>A mythical dragon, scaled in starlight and shadow, descended with a roar that shook your soul. The cultivators, powerful as they were, stood no chance. Their bodies, burned and bloodied, now lie in the clearing before you—half-dead, half-conscious. Their swords broken, their treasures scattered, their pride shattered.
<br>
<br>And now… they are within your reach.
<br>
<br>Observe [[righteous cultivator->Intro][$pe=2]] / [[demonic cultivator->Intro][$pe=3]]
<br>Help [[righteous cultivator->Intro][$pe=4]] / [[demonic cultivator->Intro][$pe=5]]
<br>Kill [[righteous cultivator->Intro][$pe=6]] / [[demonic cultivator->Intro][$pe=7]]
<<set $hasHelped to null>>
<<set $helpGiven to null>>
<<set $hasKilled1 to null>>
<<set $hasKilled2 to null>>
<<elseif $pe eq 2>>
<<if $hasKilled1 eq 1>><<else>><img src="images/Story/intro1.jpg" class=center width="60%">
<br>You approach the wounded woman wrapped in white robes. Despite the blood crusted on her lips and the scorched symbols along her sleeves, her aura still pulses with a righteous glow. A badge lies near her hand—<b>Clear Sky Azure Dragon Pavilion</b>, a prestigious clan known for defending mortals from demonic beasts.
<br>
<br>Even now, her fingers twitch as if prepared to summon a final technique.
<br>
<br>Do you:
<br>
<br><<if $hasHelped is true>>You’ve already drained your Qi. You cannot help another.
<br><<else>>Help [[righteous cultivator->Intro][$pe=4]]<</if>>
<br><<if $helpGiven eq "righteous">><<else>>Kill [[righteous cultivator->Intro][$pe=6]]<</if>><</if>>
<br>Return to observe [[demonic cultivator->Intro][$pe=3]]
<br><<if $hasHelped neq null or $helpGiven neq null or $hasKilled1 neq null or $hasKilled2 neq null>><<link "Continue" "Map|Region1">><</link>> with your journey!<</if>>
<br>
<br><<elseif $pe eq 3>><<if $hasKilled2 eq 1>><<else>>
<br><img src="images/Story/intro2.jpg" class=center width="60%">
<br>The man in black robes coughs violently, blood and bile leaking from his lips. Despite his wounds, his eyes flicker with cruel cunning. His Qi is wild—corrupted. A broken pendant rests beside him: the sigil of the <b>Ghost King Netherworld Sect</b>.
<br>
<br>Yet something about the way he clutches a charm in his hand feels... personal.
<br>
<br>Do you:
<br>
<br><<if $hasHelped is true>>You’ve already drained your Qi. You cannot help another.
<br><<else>>Help [[demonic cultivator->Intro][$pe=5]] <</if>>
<br><<if $helpGiven eq "evil">><<else>>Kill [[demonic cultivator->Intro][$pe=7]]<</if>><</if>>
<br>Return to observe [[righteous cultivator->Intro][$pe=2]]
<br><<if $hasHelped neq null or $helpGiven neq null or $hasKilled1 neq null or $hasKilled2 neq null>><<link "Continue" "Map|Region1">><</link>> with your journey!<</if>>
<<elseif $pe eq 4>>
<<set $hasHelped to true>>
<<set $helpGiven to "righteous">>
<br>You kneel beside her and press your palm to her back. Your Qi flows into her shattered meridians, stabilizing her foundation. She coughs blood, then gasps sharply as the pain fades.
<br>Her eyes flutter open—golden irises lock with yours. <span class="righteous">“You... saved me,”</span> she whispers.
<br>She presses a jade token into your hand.
<br><span class="righteous">“Take this. If you ever seek the <b>Clear Sky Azure Dragon Pavilion</b>, they will receive you.”</span>
<br>
<br>You are too drained to help another.
<<set $recommendationLetter to "righteous">>
<br>Return to observe [[demonic cultivator->Intro][$pe=3]]
<br><<if $hasHelped neq null or $helpGiven neq null or $hasKilled1 neq null or $hasKilled2 neq null>><<link "Continue" "Map|Region1">><</link>> with your journey!<</if>>
<<elseif $pe eq 5>>
<<set $hasHelped to true>>
<<set $helpGiven to "evil">>
<br>You crouch by his side, ignoring the corrupted aura. Focusing your Qi, you guide it into his mangled dantian. He groans, then snarls back to life—eyes glowing with crimson light.He coughs, then tosses you a blood-stained token.
<br><span class="demonic">“You're not like the others. If you want power… come to the <b>Ghost King Netherworld Sect</b>.”</span>
<br>
<br>You feel dizzy—there’s no way you could stabilize another after this.
<<set $recommendationLetter to "evil">>
<br>Return to observe [[righteous cultivator->Intro][$pe=2]]
<br><<if $hasHelped neq null or $helpGiven neq null or $hasKilled1 neq null or $hasKilled2 neq null>><<link "Continue" "Map|Region1">><</link>> with your journey!<</if>>
<<elseif $pe eq 6>>
<br>She tries to lift her head, eyes dazed. Your blade finds her throat before she can speak.
<br>
<br>It’s quick. Her blood steams in the cold mountain air.
<br>
<br>Among her shattered belongings, you find rare herb and some spirit stones. A cache worthy of a true cultivator.
<<gainRandomItem>> <<set $gold+=random(150,350)>>
<<set $hasKilled1 to 1>>
<br>Return to observe [[demonic cultivator->Intro][$pe=3]]
<br><<if $hasHelped neq null or $helpGiven neq null or $hasKilled1 neq null or $hasKilled2 neq null>><<link "Continue" "Map|Region1">><</link>> with your journey!<</if>>
<<elseif $pe eq 7>>
<br>He senses your approach—too late. Your strike pierces his heart with precision.
<br>
<br>He gurgles a curse and slumps back, lifeless. The dark mist around him vanishes.
<br>
<br>You rummage through his possessions: rare herb and some spirit stones.
<br>
<<gainRandomItem>> <<set $gold+=random(150,350)>>
<<set $hasKilled2 to 1>>
<br>Return to observe [[righteous cultivator->Intro][$pe=2]]
<br><<if $hasHelped neq null or $helpGiven neq null or $hasKilled1 neq null or $hasKilled2 neq null>><<link "Continue" "Map|Region1">><</link>> with your journey!<</if>>
<</if>>
<<set $playerX = 0>>
<<set $playerY = 13>>
<<set _tileSize = 50>>
<<set _x = $playerX * _tileSize>>
<<set _y = $playerY * _tileSize>>
<<set $regionEvent = {
active: false,
id: null,
x: null,
y: null,
duration: 0
}>>
<<set $map = [
[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],
[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],
[1,1,1,1,1,1,0,0,0,2,2,0,0,-1],
[1,1,1,1,1,1,0,0,0,2,2,0,0,-1],
[0,0,0,0,0,0,0,0,0,0,0,0,0,-1],
[0,0,0,0,0,0,0,0,0,0,0,0,0,-1],
[0,3,0,0,0,0,0,0,0,0,0,0,0,-1],
[0,0,0,0,0,0,0,0,0,0,0,0,0,-1],
[0,0,0,0,0,0,0,0,0,0,0,0,0,-1],
[0,0,0,0,0,0,0,0,0,0,0,0,0,-1],
[0,0,0,0,0,0,0,0,0,0,0,0,0,-1],
[0,0,0,0,0,0,0,0,0,0,0,0,0,-1],
[0,0,2,0,0,0,0,0,0,0,0,0,0,-1],
[0,0,0,0,0,0,0,0,0,0,0,0,0,-1]
]>>
<<set $CurrentPcSectRank to "">>
<</nobr>><<set $playername to "Ziyan">>
<<set $playersurname to "Bai">>
<<audio "background1" volume 0.2 play loop>>
Welcome in <b><i>The Destined to Ascend</i></b>!
To begin, first select difficulty, then click 'Continue'.
<table class="stat-table">\
<tr>\
<th>Easy</th>
<th>Normal</th>
<th>Hard</th>
</tr>
<tr>
<td>
<b>🌍World</b>: Qi: High, Herb: High, Ore: High, Price: Low
<b>🧍♂️Character</b>: Initial stats: 150%, Higher grade of nature, ressurection stones = 9
<b>👹Monsters</b>: Monster HP: 75%, Monster damage: 75%, Monster ammount: Less frequent
<<link "Choose this difficulty" "Opening and Name">><<set $difficulty to "easy">><</link>>
</td>
<td>
<b>🌍World</b>: Qi: Normal, Herb: Normal, Ore: Normal, Price: Normal
<b>🧍♂️Character</b>: Initial stats: 100%, Standard grade of nature, ressurection stones = 6
<b>👹Monsters</b>: Monster HP: 100%, Monster damage: 100%, Monster ammount: Standard
<<link "Choose this difficulty" "Opening and Name">><<set $difficulty to "normal">><</link>>
</td>
<td>
<b>🌍World</b>: Qi: Low, Herb: Low, Ore: Low, Price: High
<b>🧍♂️Character</b>: Initial stats: 75%, Standard grade of nature, ressurection stones = 3
<b>👹Monsters</b>: Monster HP: 125%, Monster damage: 125%, Monster ammount: More frequent
<<link "Choose this difficulty" "Opening and Name">><<set $difficulty to "hard">><</link>>
</td>
</tr>
</table>
<<if $difficulty eq null>>Please select difficulty to continue.<<else>> Selected difficulty: <b>$difficulty</b>. <<link "Continue?" "Character Creation">><</link>><</if>><<if $verystart eq 0>><<else>>\
<<print $playerX>>: X
<<print $playerY>>: Y
<br><<UpdatePortrait>>
<br><b>Name</b>: $playerfullname
<br><b>Realm:</b> <<cultivationStatus>>
<br><b>Sect:</b> <<if $CurrentPcAffiliation neq "" or null>><<print $CurrentPcSectRank>> of <<print $CurrentPcAffiliation>><<else>><<print "None">><</if>>
<br><b>Wealth:</b> <<print $gold>> spirit stones
<br><b><<link "📖 Journal" "Journal">><</link>></b>
<div id="right-sidebar-content">
<<ReputationAlignmentBar>>
<<JadeLetterCheck>><<JadeLetterInboxIcon>>
<<JadeLetterPopup>>
</div>
<</if>>
<<JadeLetterInit>>/*==============================================================
<<JadeLetterCheck>>
Place in a :passageEnd or your main hub passage.
Rolls once per passage — only generates a letter if enough
turns have passed AND the random roll succeeds.
Chance: 30% per 3-turn window (configurable below).
==============================================================*/
<<widget "JadeLetterCheck">>
<<silently>>
<<if ndef $jadeLetters>><<set $jadeLetters to []>><</if>>
<<if ndef $jadeLetterLastCheck>><<set $jadeLetterLastCheck to 0>><</if>>
<<if ndef $jadeLetterHookupPending>><<set $jadeLetterHookupPending to []>><</if>>
<<set _jlTotal to JadeLetterSystem.totalTurns()>>
<<set _jlInterval to 3>> /* turns between eligibility windows */
<<set _jlChance to 30>> /* % chance per eligible window */
<<if (_jlTotal - $jadeLetterLastCheck) gte _jlInterval>>
<<set $jadeLetterLastCheck to _jlTotal>>
<<if random(1, 100) lte _jlChance>>
<<set _jlNPC to JadeLetterSystem.pickSender()>>
<<if _jlNPC neq null>>
<<set _jlRel to JadeLetterSystem.getRelLabel(_jlNPC)>>
<<set _jlCat to JadeLetterSystem.pickCategory(_jlNPC, _jlRel)>>
<<set _jlLoc to JadeLetterSystem.hookupLocations[random(0, JadeLetterSystem.hookupLocations.length - 1)]>>
<<set _jlExpiry to _jlTotal + 9>> /* 9 turns to respond to hookups */
<<set _letter to {
id: _jlTotal + "_" + _jlNPC.id,
npcId: _jlNPC.id,
npcName: _jlNPC.fullname,
npcPortrait: _jlNPC.npcPortrait,
npcGender: _jlNPC.gender,
category: _jlCat,
location: _jlLoc,
relLabel: _jlRel,
body: JadeLetterSystem.buildMessage(_jlNPC, _jlCat, _jlLoc),
replies: JadeLetterSystem.buildReplies(_jlCat, $corruption),
turnSent: _jlTotal,
expiryTurn: _jlExpiry,
read: false,
replied: false,
replyChosen: null,
accepted: null
}>>
<<run $jadeLetters.unshift(_letter)>>
<</if>>
<</if>>
<</if>>
<</silently>>
<</widget>>
/*==============================================================
<<JadeLetterInboxIcon>>
Small notification icon — place in your HUD / stats bar.
Shows 📜 with unread count badge.
==============================================================*/
<<widget "JadeLetterInboxIcon">>
<<if ndef $jadeLetters>><<set $jadeLetters to []>><</if>>
<<set _jlUnread to $jadeLetters.filter(function(l){ return !l.read; }).length>>
<span class="jade-letter-icon">
<<if _jlUnread gt 0>>
[[📜|JadeLetterInbox]] <span class="jade-letter-badge"><<= _jlUnread >></span>
<<else>>
[[📜|JadeLetterInbox]]
<</if>>
</span>
<</widget>>
/*==============================================================
<<JadeLetterPopup>>
Inline popup shown in main hub passages when a NEW unread
letter arrives (only shows the most recent unread one).
Mimics MainStoryLinePopUP style.
==============================================================*/
<<widget "JadeLetterPopup">>
<<set _jlNew to $jadeLetters.find(function(l){ return !l.read; })>>
<<if _jlNew neq undefined>>
<div class="jade-letter-popup">
📜 <strong><<= _jlNew.npcName >></strong> has sent you a jade letter.
<span class="jade-letter-popup-link">[[Open Inbox|JadeLetterInbox]]</span>
</div>
<</if>>
<</widget>>
/*==============================================================
<<JadeLetterHookupCheck LOCATION>>
Place in any location passage you want to support hookup
arrivals. Pass the location name as argument.
e.g. <<JadeLetterHookupCheck "Northern Phoenix City">>
==============================================================*/
<<widget "JadeLetterHookupCheck">>
<<set _jlCurrentLoc to _args[0]>>
<<set _jlTotal to JadeLetterSystem.totalTurns()>>
<<set _jlPending to $jadeLetterHookupPending.filter(function(h){
return h.location eq _jlCurrentLoc and _jlTotal lte h.expiryTurn;
})>>
<<if _jlPending.length gt 0>>
<<set _jlHookup to _jlPending[0]>>
<<set _jlHookupNPC to $known_npc_list.find(function(n){ return n.id eq _jlHookup.npcId; })>>
<<if _jlHookupNPC neq null and _jlHookupNPC neq undefined>>
<div class="jade-letter-hookup-arrive">
💌 <strong><<= _jlHookupNPC.fullname >></strong> is here, awaiting you as agreed.
[[Meet them now|EncounterInteractionSex][$sexPartner to _jlHookupNPC, $sexType to "romantic", $sexReturnPassage to passage(), _jlHookupId to _jlHookup.id]]
<span class="jade-letter-decline-link">
[[Not tonight — leave|JadeLetterHookupDeclineArrival][$currentHookupId to _jlHookup.id]]
</span>
</div>
<</if>>
<</if>>
<</widget>>/*==============================================================
JADE LETTER INBOX — full passage
==============================================================*/
<div class="jade-letter-inbox">
<h2>📜 Jade Letters</h2>
<<if $jadeLetters.length eq 0>>
<p class="jade-letter-empty">Your message stone sits silent. No letters have arrived.</p>
<<else>>
<<set _jlTotal to JadeLetterSystem.totalTurns()>>
<<for _li, _letter range $jadeLetters>>
<<set _jlExpired to (_letter.category eq "hookup" and _jlTotal gt _letter.expiryTurn and !_letter.replied)>>
<div class="jade-letter-entry <<if !_letter.read>>jade-letter-unread<</if>> <<if _jlExpired>>jade-letter-expired<</if>>">
<div class="jade-letter-header">
<span class="jade-letter-sender">
<<if !_letter.read>>✉ <</if>>
<<= _letter.npcName >>
</span>
<span class="jade-letter-meta">
<<= _letter.relLabel >> · turn <<= _letter.turnSent >>
<<if _letter.category eq "hookup" and !_letter.replied and !_jlExpired>>
· ⏳ expires turn <<= _letter.expiryTurn >>
<</if>>
<<if _jlExpired>> · <em>proposal lapsed</em><</if>>
</span>
</div>
<div class="jade-letter-body">
<<= _letter.body >>
</div>
<<if _letter.category eq "hookup" and !_letter.replied and !_jlExpired>>
<div class="jade-letter-location-note">
📍 Proposed meeting place: <strong><<= _letter.location >></strong>
— [[Travel there|<<= _letter.location >>][$pendingHookupId to _letter.id]]
</div>
<</if>>
<<if !_letter.replied and !_jlExpired>>
<div class="jade-letter-replies">
<span class="jade-letter-reply-label">Zyanbai's reply:</span>
<<for _ri, _reply range _letter.replies>>
<<capture _li, _ri, _reply>>
<span class="jade-letter-reply-option
<<if _reply.align eq 'righteous'>>jade-reply-righteous
<<elseif _reply.align eq 'demonic'>>jade-reply-demonic
<<else>>jade-reply-neutral<</if>>">
<<link _reply.label "JadeLetterReply">>
<<set $jlReplyLetterIdx to _li>>
<<set $jlReplyOptionIdx to _ri>>
<</link>>
</span>
<</capture>>
<</for>>
</div>
<<elseif _letter.replied>>
<div class="jade-letter-sent">
✔ Sent: <em><<= _letter.replyChosen >></em>
</div>
<</if>>
</div>
<</for>>
<</if>>
<div class="jade-letter-back">
[[← Return|Map|Region1]]
</div>
</div>/*==============================================================
Handles reply selection — applies stat changes, marks read,
queues hookup if accepted.
==============================================================*/
<<set _jlLetter to $jadeLetters[$jlReplyLetterIdx]>>
<<set _jlOption to _jlLetter.replies[$jlReplyOptionIdx]>>
<<set _jlNPC to $known_npc_list.find(function(n){ return n.id eq _jlLetter.npcId; })>>
<<set _jlTotal to JadeLetterSystem.totalTurns()>>
<<silently>>
/* Mark letter as read and replied */
<<set $jadeLetters[$jlReplyLetterIdx].read to true>>
<<set $jadeLetters[$jlReplyLetterIdx].replied to true>>
<<set $jadeLetters[$jlReplyLetterIdx].replyChosen to _jlOption.label>>
/* Apply friendship delta to the NPC object */
<<if _jlNPC neq null and _jlNPC neq undefined and _jlOption.friendDelta neq 0>>
<<set _jlIdx to $known_npc_list.findIndex(function(n){ return n.id === _jlLetter.npcId; })>>
<<if _jlIdx gte 0>>
<<set $known_npc_list[_jlIdx].friendship += _jlOption.friendDelta>>
<<if $known_npc_list[_jlIdx].friendship lt 0>><<set $known_npc_list[_jlIdx].friendship to 0>><</if>>
<</if>>
<</if>>
/* Hookup: queue in pending list if accepted */
<<if _jlLetter.category eq "hookup" and _jlOption.accepted eq true>>
<<set $jadeLetters[$jlReplyLetterIdx].accepted to true>>
<<run $jadeLetterHookupPending.push({
id: _jlLetter.id,
npcId: _jlLetter.npcId,
location: _jlLetter.location,
expiryTurn: _jlTotal + 9
})>>
<<elseif _jlLetter.category eq "hookup" and _jlOption.accepted eq false>>
<<set $jadeLetters[$jlReplyLetterIdx].accepted to false>>
<</if>>
<</silently>>
<div class="jade-letter-reply-confirm">
<p>You compose your reply.</p>
<p><em><<= _jlOption.text >></em></p>
<<if _jlOption.friendDelta gt 0>>
<p class="jade-stat-up">Your bond with <<= _jlLetter.npcName >> deepens. (+<<= _jlOption.friendDelta >> friendship)</p>
<<elseif _jlOption.friendDelta lt 0>>
<p class="jade-stat-down">The distance between you and <<= _jlLetter.npcName >> widens. (<<= _jlOption.friendDelta >> friendship)</p>
<</if>>
<<if _jlLetter.category eq "hookup" and _jlOption.accepted eq true>>
<p class="jade-letter-hookup-confirm">
📍 You have agreed to meet <strong><<= _jlLetter.npcName >></strong> at <strong><<= _jlLetter.location >></strong>.
Travel there within the agreed time — the arrangement will expire in 9 turns.
[[Travel to <<= _jlLetter.location >>|<<= _jlLetter.location >>]]
</p>
<</if>>
[[← Back to Inbox|JadeLetterInbox]]
</div>/*==============================================================
Player chose not to meet the NPC who arrived at the location.
Remove from pending queue, apply friendship penalty.
==============================================================*/
<<set _jlHookupIdx to $jadeLetterHookupPending.findIndex(function(h){ return h.id eq $currentHookupId; })>>
<<if _jlHookupIdx gte 0>>
<<set _jlHookupData to $jadeLetterHookupPending[_jlHookupIdx]>>
<<set _jlNPCidx to $known_npc_list.findIndex(function(n){ return n.id eq _jlHookupData.npcId; })>>
<<if _jlNPCidx gte 0>>
<<set $known_npc_list[_jlNPCidx].friendship to Math.max(0, $known_npc_list[_jlNPCidx].friendship - 8)>>
<</if>>
<<run $jadeLetterHookupPending.splice(_jlHookupIdx, 1)>>
<</if>>
<p>You slip away without meeting them. Word of such slights travels.</p>
<p class="jade-stat-down">(-8 friendship)</p>
[[← Return|Map|Region1]]/*==============================================================
<<JadeLetterCleanup>>
Optional: trim inbox to last 20 letters and purge expired
hookup proposals. Call once a game-year or in a rest passage.
==============================================================*/
<<widget "JadeLetterCleanup">>
<<silently>>
<<set _jlTotal to JadeLetterSystem.totalTurns()>>
/* Remove expired hookup proposals */
<<set $jadeLetterHookupPending to $jadeLetterHookupPending.filter(function(h){
return _jlTotal lte h.expiryTurn;
})>>
/* Keep only latest 20 letters */
<<if $jadeLetters.length gt 20>>
<<set $jadeLetters to $jadeLetters.slice(0, 20)>>
<</if>>
<</silently>>
<</widget>><<if $verystart eq 0>><<else>>\
<<if $activeSideMission neq null>>
<br><b>Current Mission:</b> <<print $activeSideMission.name>>
<<link "❌" `passage()`>>
<<set $activeSideMission to null>>
<<set $SideMissionStatus to null>>
<</link>>
<</if>>
<div id="era-tracker">
<<EraTracker>>
</div>
<div id="stats-recovery">
<<statusCondition>>
</div>
<span style="font-size:10px; color:#b8860b; text-transform:uppercase;">Spirit Ambience</span><br>
<<volume>>
<br><b>Corruption</b>: $corruption
<br><b>Experience</b>: <<print $exp.toFixed(1)>>
<<if $battleRound eq 0>>
<div class="newsidebar-nav-grid">
<span title="Status">
<<link "👤" "Status">><</link>>
</span>
<span title="Skills">
<<link "📜" "Skills">><</link>>
</span>
<span title="Inventory">
<<link "🎒" "Inventory">><</link>>
</span>
<span title="Relations">
<<link "🤝" "Relations">><</link>>
</span>
<span title="Breakthrough">
<<link "🪷" "Breakthrough">><</link>>
</span>
<span title="Help">
<<link "❓" "Help">><</link>>
</span>
</div>
<</if>>
<</if>>
<div class="newsidebar-system-footer">
<span title="Chronicles (Saves)">
<<link "💾">><<run UI.saves()>><</link>>
</span>
<span title="Meditation (Settings)">
<<link "⚙️">><<run UI.settings()>><</link>>
</span>
<span title="Rebirth (Restart)">
<<link "🔄">><<run UI.restart()>><</link>>
</span>
</div><<include Stats>>
<<include Naming>>
<<include Destiny>>
<<include PlayerI>>
<<include Items>>
<<include NPC>>
<<include AlchemyItems>>
<<include Potions>>
<<include PotionRecipes>>
<<include SideMissions>>
<<include SpecialArts>>
<<include Dtalks>>
<<include MainMissions>>
<<include MerchantItems>>
<<include PlayerBeasts>>
<<include WorldState>>
<<set _bgm = setup.SoundPath + "background1.mp3">>
<<cacheaudio "background1" _bgm>>
<<set _bgm = setup.SoundPath + "background2.mp3">>
<<cacheaudio "background2" _bgm>>
<<set $PlayerLocation to "">>
<<set $CurrentGameVersion to 0.16>>
<<set $gameVersion to 0.16>><<set $worldState to {
activeWar: null, /* Stores { sideA: "", sideB: "", endTurn: 0 } */
forbiddenZoneOpen: 0, /* Turn number when a zone closes */
globalCalamity: false
}>><<if $a eq 0>>
<<nobr>>
<div class="flex-container"><img src="images/Character/fmc.png" style="float: left;"><div>
<br><b>Surname:</b> $playersurname <b>Lifespan</b> : $lifespan / $maxlifespan
<br><b>Name:</b> $playername <b>Sex</b>: Female
<br><b>Charisma:</b>
<br><b>Realm:</b> <<cultivationStatus>>
<br><b>Internal Trait:</b> <span id="internalDisplay"><<= $internalTrait>></span>
<br><<for _index, _trait range $internalOptions>>
<<capture _t = _trait>>
<<link _trait>><<set $internalTrait to _trait>>
<<replace "#internalDisplay">><<=$internalTrait>>
<</replace>>
<</link>>
<</capture>>
<</for>>
<br><b>External Trait:</b> <span id="externalDisplay"><<= $externalTrait>></span>
<br><<for $index, _trait range $externalOptions>>
<<capture _t=_trait>>
<<link _trait>><<set $externalTrait to _trait>>
<<replace "#externalDisplay">><<=$externalTrait>>
<</replace>>
<</link>>
<</capture>>
<</for>>
</div>
<</nobr>>
<div style="text-align: center;">
Please choose your desired traits!
<<link "Stats" "Character Creation 2">><<set $a to 1>><</link>></div>
<<elseif $a eq 1>>
<div style="display: flex; align-items: center; gap: 20px;">
/* COLUMN 1: THE IMAGE */
<div style="flex: 0 0 auto;">
<img src="images/Character/fmc.png" style="max-height: 500px; display: block;">
</div>
<<ConstitutionCalc>>
/* COLUMN 2: THE DESTINY SELECTION */
<div style="flex: 1;">
<b><<link "⟳" "Character Creation 2">> <<set $destinyList.shuffle()>><<set $playerDestiny = []>><<updateDestinyStats>><</link>> Destiny </b>
<i>selected destinies:</i>
<span style="display: inline-block; margin-left: 10px;">
<<nobr>>
<<for _a to 0; _a lt $playerDestiny.length; _a++>>
<span style="margin-right: 10px;">
<<print _a + 1>>.
<<capture _a>>
<<link $playerDestiny[_a].name "Character Creation 2">>
<<set $playerDestiny.delete($playerDestiny[_a])>>
<<updateDestinyStats>>
<<StatsUpdater>>
<</link>>
<</capture>>
</span>
<</for>>
You have awakened the <<hovertip $constitutionDesc>><b>$constitutionName</b>!
<</hovertip>>
<</nobr>>
</span>
<div style="margin-top: 20px;">
<<nobr>>
<table style="width: 100%; table-layout: fixed; border-collapse: collapse;">
<tr>
<<for _d to 0; _d lt 4; _d++>>
<<set _destiny = $destinyList[_d]>>
<<capture _d, _destiny>>
<<set _statMap = {
"destinyatk": "Attack", "destinydef": "Defense", "destinycrit": "Critical Rate",
"destinycritres": "Crit Resist", "destinyagility": "Agility", "destinymartialArts": "Martial Arts",
"destinyspiritualRoot": "Spiritual Root", "righteousreputation": "Righteous Rep",
"demonicreputation": "Demonic Rep", "destinylifespan": "Lifespan",
"destinyenergy": "Energy", "destinyhealth": "Health"
}>>
<<set _tip = '<div style="width:300px; margin-bottom: 5px;">' + _destiny.description + '</div><hr><div style="display: grid; grid-template-columns: 1fr 1fr; gap: 3px; width: 300px; font-size: 0.9em;">'>>
<<for _key, _label range _statMap>>
<<if _destiny[_key] !== 0>>
<<set _val = _destiny[_key]>>
<<set _color = (_val > 0 ? "#7fff00" : "#ff4500")>>
<<set _tip += '<span>' + _label + ': <b style="color:' + _color + ';">' + (_val > 0 ? "+" : "") + _val + '</b></span>'>>
<</if>>
<</for>>
<<set _tip += '</div>'>>
<td style="text-align: center; vertical-align: top; padding: 10px 2px;">
<<hovertip _tip>>
<div style="display: flex; flex-direction: column; align-items: center; min-height: 100px;">
<span style="font-size: 1.5em; margin-bottom: 8px;">
<<if _destiny.rarity is "Red">>🔴<<elseif _destiny.rarity is "Purple">>🟣<<elseif _destiny.rarity is "Orange">>🟠<<elseif _destiny.rarity is "Grey">>⚪<<elseif _destiny.rarity is "Green">>🟢<<elseif _destiny.rarity is "Blue">>🔵<</if>>
</span>
<<set _alreadyChosen to false>>
<<for _i to 0; _i lt $playerDestiny.length; _i++>>
<<if $playerDestiny[_i].name == _destiny.name>>
<<set _alreadyChosen to true>>
<</if>>
<</for>>
<div style="width: 90px; font-size: 0.85em; line-height: 1.2; overflow-wrap: break-word;">
<<if not _alreadyChosen>>
<<link _destiny.name "Character Creation 2">>
<<if $playerDestiny.length < 3>>
<<set $playerDestiny.push(_destiny)>>
<<updateDestinyStats>>
<</if>>
<</link>>
<<else>>
<span style="opacity: 0.4; filter: grayscale(100%);">_destiny.name</span>
<</if>>
</div>
</div>
<</hovertip>>
</td>
<</capture>>
<</for>>
</tr>
</table>
<</nobr>>
</div>
</div>
</div>
<p>
<table class="small-table">
<tr>
<th>General</th>
<th>Combat</th>
</tr>
<tr>
<td>
<br><b>🧬 Lifespan:</b> <<=$lifespan>> / <<=$maxlifespan>>
<br><b>❤️ Health:</b> <<=$health>> / <<=$maxhealth>>
<br><b>⚡ Energy:</b> <<=$energy>> / <<=$maxenergy>>
<br><b>🍀 Luck:</b> <<=$luck>>
<br><b>🧠 Insight:</b> <<=$insight>>
<br><b>💪 Strength:</b> <<=$basestrength>>
<br><b>🌀 Willpower:</b> <<=$basewillpower>>
<br><b>🧘♂️ Energy Recovery:</b> <<print $energyRecovery * 100>>%
</td>
<td>
<br><b>🗡️ Attack:</b> <<=$atk>>
<br><b>🛡️ Defense:</b> <<=$def>>
<br><b>💥 Crit Rate:</b> <<=$crit>>%
<br><b>🛑 Crit Resist</b>: <<=$critres>>%
<br><b>👟 Agility</b>: <<=$agility>>
<br><b>🥋 Martial Arts:</b> <<=$martialArts>>
<br><b>🌌 Spiritual Root:</b> <<=$spiritualRoot>>
<br><b>🩸 Health Recovery:</b> <<print $healthRecovery * 100>>%
</td>
</tr>
</table></p><</if>>
<<if $playerDestiny.length eq 3>><<link "Continue" "Intro">><<set $pe to 0>><<set $verystart to 1>><</link>><</if>>\
<div class="name-box">
<p>Enter your name and surname, or let fate decide.</p>
<<textbox "$playersurname" $playersurname>> <<link "<b>⟳</b>">> <<set $playersurname to $playersurnameList.random()>> <<run document.getElementById("textbox-playersurname").value = SugarCube.State.active.variables.playersurname>><</link>>
<<textbox "$playername" $playername>> <<link "<b>⟳</b>">> <<set $playername to $playernameList.random()>> <<run document.getElementById("textbox-playername").value = SugarCube.State.active.variables.playername>><</link>>
<div class="name-button">
<<link "Use This Name">>
<<goto "Character Creation 2">><<set $a to 0>>
<</link>>
</div>
</div>
<<set $internalTrait to $internalOptions.random()>>
<<set $externalTrait to $externalOptions.random()>><<widget "SoulflareReversal">>
Your soul ignites like a phoenix ember as you defy fate itself! Time rewinds and death is denied.
<<AbilityImagex $ability 250>><</AbilityImagex>>
<<set $health = $health + $maxhealth * 0.3>>
<<set $soulflareUsed = true>>
You restore 30% of your health and resist death!
<<if $abilitylevel gte 2>>
<<set _reflected = $enemyatk * 0.5>>
<<set $enemycurrenthealth -= _reflected>>
You reflect $_reflected damage back to the enemy!
<</if>>
<</widget>>
<<widget "HeavenSplittingPalm">>
You summon your spiritual energy into your palm and unleash a Heaven-Splitting strike that shakes the heavens!
<<AbilityImagex $ability 250>><</AbilityImagex>>
<<set $defPierce = $currentEnemy.NPCdef * 0.5>>
<<set $abilityvalue = ($baseatk * 2.8) - $defPierce>>
<<if $abilitylevel gt 1>>
<<set $abilityvalue += 0.2 * $basestrength * $abilitylevel>>
<</if>>
You deal <<print $abilityvalue.toFixed(2)>> damage, ignoring part of enemy defense!
<<set $currentEnemy.NPCcurrenthealth -= $abilityvalue>>
<<if $abilitylevel gte 3 and random(1, 100) lte 25>>
<<set $enemyStaggered = true>>
The enemy is staggered and loses their next action!
<</if>>
<</widget>>
<<widget "StoneheartConstitution">>
You draw upon the tempered strength of your Stoneheart Constitution.
<<set $passivedef += 5 + ($level * 2)>>
Your base defense has increased by <<print 5 + ($activePassiveLevel * 2)>> points!
<</widget>>
<<widget "VenomFangSlash">>
You lunge forward with a venomous claw strike, leaving a lingering poison!
<<AbilityImagex $ability 250>><</AbilityImagex>>
<<set $defPierce = $currentEnemy.NPCdef * 0.3>>
<<set $abilityvalue = ($baseatk * 1.5) - $defPierce>>
You slash the enemy for $abilityvalue damage!
<<set $currentEnemy.NPCcurrenthealth -= $abilityvalue>>
<<set _poisonDmg = 0.05 * $maxhealth>>
The enemy is poisoned, taking $_poisonDmg damage over time!
<<if $abilitylevel gte 2>>
<<set _critChance = 20>>
<<if random(1,100) lte _critChance>>
<<set $critBonus = $abilityvalue * 0.5>>
Critical strike! You deal an extra $critBonus damage!
<<set $currentEnemy.NPCcurrenthealth -= $critBonus>>
<</if>>
The poison lasts longer at this level!
<</if>>
<</widget>>
<<widget "UnholyEndurance">>
You embrace the corruption within, hardening your body against pain.
<<set $passivedef += 10 + (2 * $abilitylevel)>>
Your defense rises by <<print 10 + (2 * $abilitylevel)>> points!
<<if $abilitylevel gte 2>>
<<set $resistStatus = true>>
You gain resistance to weakening and harmful effects!
<</if>>
<</widget>>
<<widget "BloodCurseMark">>
You carve a sigil of blood into the air, cursing your foe with dark power!
<<AbilityImagex $ability 250>><</AbilityImagex>>
<<set $abilityvalue = ($basemaxenergy * 2) - ($currentEnemy.NPCdef * 0.4)>>
You sacrifice health to empower the curse.
<<set $health -= 0.1 * $maxhealth>>
You lose 10% of your health but deal $abilityvalue damage!
<<set $currentEnemy.NPCcurrenthealth -= $abilityvalue>>
The enemy is cursed — their healing is reduced, and they take extra damage!
<<if $abilitylevel gte 2>>
The curse lingers longer and grows more vicious!
<</if>>
<<if $abilitylevel gte 3 and random(1,100) lte 30>>
Dark power spreads! Another nearby foe is also afflicted!
<</if>>
<</widget>>
<<widget "FallingStarPalm">>
You channel power into your palm and strike down like a blazing star, shattering the ground!
<<AbilityImagex $ability 250>><</AbilityImagex>>
<<set $defPierce = $currentEnemy.NPCdef * 0.4>>
<<set $abilityvalue = ($baseatk * 1.6) - $defPierce>>
You deal $abilityvalue damage with explosive force!
<<set $currentEnemy.NPCcurrenthealth -= $abilityvalue>>
<<if $abilitylevel gte 2>>
The strike’s impact radiates outward, hitting nearby foes for <<print $abilityvalue * 0.5>> splash damage!
<</if>>
<</widget>>
<<widget "RadiantLotus">>
A lotus of radiant qi blooms within you, harmonizing body and spirit.
Your healing effects are increased by <<print 10 + (5 * ($abilitylevel - 1))>>%!
<<if $abilitylevel gte 2>>
Your inner clarity strengthens, slightly improving your energy recovery!
<</if>>
<</widget>>
<<widget "HeavenwardBarrier">>
You raise a shield of celestial light, warding off death itself!
<<AbilityImagex $ability 250>><</AbilityImagex>>
The barrier will block a single fatal strike and restore health when triggered.
<<if $abilitylevel gte 2>>
The shield grows stronger, restoring more health when it activates!
<</if>>
<<if $abilitylevel gte 3>>
The celestial shield also reflects part of the blocked damage back at the attacker!
<</if>>
<</widget>><<if $corruption >= $equippedRobe.corruptionLock and $corruption >= $equippedUnderwear.corruptionLock>>
<<link "Go back" $passage>><</link>>
<</if>>
<<nobr>>
<div class="achievements-container">
<h2 class="achievements-title">Heavenly Records</h2>
<p class="achievements-count">
Unlocked: <<print State.variables.achievements.length>> / <<print window.achievementsList.length>>
</p>
<div class="achievements-scroll">
<<set _sortedList to window.getSortedAchievements()>>
<<set _unlocked to State.variables.achievements>>
<<for _ach range _sortedList>>
<<if _unlocked.includes(_ach.id)>>
<div class="achievement-item unlocked">
<div class="achievement-name"><<print _ach.title>></div>
<div class="achievement-desc"><<print _ach.desc>></div>
</div>
<<else>>
<div class="achievement-item locked">
<div class="achievement-name">???</div>
<div class="achievement-desc">A hidden truth awaits...</div>
</div>
<</if>>
<</for>>
</div>
<<link "Return" $passage>><</link>>
</div>
<</nobr>><<if $corruption >= $equippedRobe.corruptionLock and $corruption >= $equippedUnderwear.corruptionLock>>
<<link "Go back" $passage>><</link>>
<<else>>
<i>I should probably put some clothes on ...</i>
<</if>>
<<nobr>><<StatsUpdater>>
<div class="breakthrough-container">
<div class="breakthrough-header">
<h2>Breakthrough</h2>
<p>Channel your qi, face the heavens, and ascend to new heights!</p>
</div>
<img src="images/Story/breakthrough.png" class="breakthrough-portrait" alt="Cultivation Breakthrough">
<<Breakthrough>>
</div>
<</nobr>><<BreakthroughEvent>>rarity(high to low) - red, purple, orange, grey, green, blue
<<set $playerDestiny to []>>
BLANKDESTINY = [
{
"name": "NAME",
"rarity": "COLOR",
"description": "DESCRIPTION",
"destinyatk": 0,
"destinydef": 0,
"destinycrit": 0,
"destinycritres": 0,
"destinyagility": 0,
"destinymartialArts": 0,
"destinyspiritualRoot": 0,
"righteousreputation": 0,
"demonicreputation": 0,
"destinylifespan": 0,
"destinyenergy": 0,
"destinyhealth": 0,
<<set $destinyList to [
{
"name": "Child of Flame",
"rarity": "Red",
"description": "Born with the power of fire. Your soul burns brighter than others.",
"destinyatk": 5,
"destinydef": 2,
"destinycrit": 3,
"destinycritres": 0,
"destinyagility": 1,
"destinymartialArts": 0,
"destinyspiritualRoot": 5,
"righteousreputation": 5,
"demonicreputation": 0,
"destinylifespan": 0,
"destinyenergy": 10,
"destinyhealth": 0,
"essence": "Fire"
},
{
"name": "Silent Blade",
"rarity": "Blue",
"description": "Trained in the shadows, you strike before anyone senses danger.",
"destinyatk": 3,
"destinydef": 1,
"destinycrit": 5,
"destinycritres": 2,
"destinyagility": 5,
"destinymartialArts": 4,
"destinyspiritualRoot": 0,
"righteousreputation": 0,
"demonicreputation": 5,
"destinylifespan": 0,
"destinyenergy": 5,
"destinyhealth": 0,
"essence": "Martial"
},
{
"name": "Heaven's Oracle",
"rarity": "Purple",
"description": "Blessed with divine foresight, your insight shapes the world.",
"destinyatk": 1,
"destinydef": 0,
"destinycrit": 0,
"destinycritres": 3,
"destinyagility": 0,
"destinymartialArts": 0,
"destinyspiritualRoot": 8,
"righteousreputation": 10,
"demonicreputation": 0,
"destinylifespan": 50,
"destinyenergy": 20,
"destinyhealth": 0,
"essence": "Heaven"
},
{
"name": "Cursed Survivor",
"rarity": "Grey",
"description": "You lived, but something dark clings to your soul.",
"destinyatk": 2,
"destinydef": 3,
"destinycrit": 0,
"destinycritres": 4,
"destinyagility": 1,
"destinymartialArts": 1,
"destinyspiritualRoot": 0,
"righteousreputation": -5,
"demonicreputation": 10,
"destinylifespan": -10,
"destinyenergy": 0,
"destinyhealth": 20,
"essence": "Demonic"
},
{
"name": "Wandering Fist",
"rarity": "Green",
"description": "A martial nomad who trains endlessly under the open sky.",
"destinyatk": 3,
"destinydef": 3,
"destinycrit": 2,
"destinycritres": 1,
"destinyagility": 3,
"destinymartialArts": 6,
"destinyspiritualRoot": 0,
"righteousreputation": 3,
"demonicreputation": 0,
"destinylifespan": 10,
"destinyenergy": 5,
"destinyhealth": 10,
"essence": "Martial"
},
{
"name": "Undying Will",
"rarity": "Orange",
"description": "Even death cannot stop your pursuit of purpose.",
"destinyatk": 2,
"destinydef": 5,
"destinycrit": 0,
"destinycritres": 5,
"destinyagility": 0,
"destinymartialArts": 2,
"destinyspiritualRoot": 3,
"righteousreputation": 0,
"demonicreputation": 5,
"destinylifespan": 100,
"destinyenergy": 0,
"destinyhealth": 30,
"essence": "Body"
},
{
"name": "Scholar of Forbidden Tomes",
"rarity": "Purple",
"description": "You’ve studied secrets mortals weren’t meant to know.",
"destinyatk": 0,
"destinydef": 1,
"destinycrit": 2,
"destinycritres": 2,
"destinyagility": 0,
"destinymartialArts": 0,
"destinyspiritualRoot": 10,
"righteousreputation": -3,
"demonicreputation": 10,
"destinylifespan": 60,
"destinyenergy": 30,
"destinyhealth": -10,
"essence": "Mind"
},
{
"name": "Mountainheart",
"rarity": "Blue",
"description": "You are as resilient and unyielding as stone.",
"destinyatk": 2,
"destinydef": 8,
"destinycrit": 0,
"destinycritres": 5,
"destinyagility": -2,
"destinymartialArts": 2,
"destinyspiritualRoot": 0,
"righteousreputation": 3,
"demonicreputation": 0,
"destinylifespan": 20,
"destinyenergy": 0,
"destinyhealth": 30,
"essence": "Earth"
},
{
"name": "Eyes of the Hawk",
"rarity": "Green",
"description": "Nothing escapes your gaze, no motion goes unnoticed.",
"destinyatk": 1,
"destinydef": 1,
"destinycrit": 6,
"destinycritres": 1,
"destinyagility": 4,
"destinymartialArts": 2,
"destinyspiritualRoot": 1,
"righteousreputation": 0,
"demonicreputation": 0,
"destinylifespan": 0,
"destinyenergy": 0,
"destinyhealth": 0,
"essence": "Spirit"
},
{
"name": "Golden Child",
"rarity": "Orange",
"description": "You were born destined for greatness. The heavens favor you.",
"destinyatk": 3,
"destinydef": 3,
"destinycrit": 3,
"destinycritres": 3,
"destinyagility": 3,
"destinymartialArts": 3,
"destinyspiritualRoot": 3,
"righteousreputation": 10,
"demonicreputation": 0,
"destinylifespan": 50,
"destinyenergy": 15,
"destinyhealth": 15,
"essence": "Heaven"
},
{
"name": "Corrupt Apostle",
"rarity": "Red",
"description": "You speak for powers from beyond. Their whispers guide you.",
"destinyatk": 5,
"destinydef": 0,
"destinycrit": 4,
"destinycritres": 0,
"destinyagility": 1,
"destinymartialArts": 2,
"destinyspiritualRoot": 7,
"righteousreputation": -15,
"demonicreputation": 25,
"destinylifespan": 10,
"destinyenergy": 20,
"destinyhealth": 0,
"essence": "Demonic"
},
{
"name": "Beastkin Bloodline",
"rarity": "Grey",
"description": "Somewhere in your ancestry, a feral power sleeps.",
"destinyatk": 4,
"destinydef": 2,
"destinycrit": 2,
"destinycritres": 1,
"destinyagility": 4,
"destinymartialArts": 4,
"destinyspiritualRoot": -1,
"righteousreputation": -2,
"demonicreputation": 2,
"destinylifespan": -5,
"destinyenergy": 0,
"destinyhealth": 15,
"essence": "Beast"
},
{
"name": "Royal Lineage",
"rarity": "Purple",
"description": "Blue blood flows through your veins. Expectations weigh heavily.",
"destinyatk": 2,
"destinydef": 3,
"destinycrit": 2,
"destinycritres": 2,
"destinyagility": 2,
"destinymartialArts": 1,
"destinyspiritualRoot": 4,
"righteousreputation": 7,
"demonicreputation": -1,
"destinylifespan": 10,
"destinyenergy": 10,
"destinyhealth": 10,
"essence": "Heaven"
},
{
"name": "Exiled Monk",
"rarity": "Green",
"description": "Once devoted, now wandering and awakened by hardship.",
"destinyatk": 1,
"destinydef": 2,
"destinycrit": 0,
"destinycritres": 3,
"destinyagility": 3,
"destinymartialArts": 6,
"destinyspiritualRoot": 2,
"righteousreputation": 4,
"demonicreputation": 0,
"destinylifespan": 10,
"destinyenergy": 5,
"destinyhealth": 10,
"essence": "Spirit"
},
{
"name": "Soul Parasite",
"rarity": "Red",
"description": "You survived something you shouldn’t have. It still lives in you.",
"destinyatk": 6,
"destinydef": 0,
"destinycrit": 3,
"destinycritres": 0,
"destinyagility": 1,
"destinymartialArts": 0,
"destinyspiritualRoot": 8,
"righteousreputation": -10,
"demonicreputation": 20,
"destinylifespan": -20,
"destinyenergy": 20,
"destinyhealth": -10,
"essence": "Demonic"
},
{
"name": "Frostborn Nomad",
"rarity": "Blue",
"description": "Raised in cold silence, your heart beats like permafrost.",
"destinyatk": 3,
"destinydef": 5,
"destinycrit": 1,
"destinycritres": 4,
"destinyagility": 2,
"destinymartialArts": 1,
"destinyspiritualRoot": 1,
"righteousreputation": 1,
"demonicreputation": 0,
"destinylifespan": 5,
"destinyenergy": 5,
"destinyhealth": 10,
"essence": "Ice"
}
]>><<nobr>>
<div class="journal-container">
<h2>✦ The Scribe's Journal ✦</h2>
<!-- Filters -->
<div class="journal-filters">
<label>Filter by type:</label>
<select id="journal-filter-type">
<option value="all">All</option>
<option value="grudge">Grudges</option>
<option value="sex">Sexual Encounters</option>
<option value="combat">Combat & Deaths</option>
<option value="reputation">Reputation</option>
<option value="breakthrough">Breakthroughs</option>
<option value="cultivation">Cultivation</option>
<option value="story">Story Events</option>
<option value="mission">Missions</option>
</select>
<label>Sort by:</label>
<select id="journal-sort">
<option value="newest">Newest first</option>
<option value="oldest">Oldest first</option>
<option value="importance">Importance (high to low)</option>
</select>
<<if $journalEntries.length gt 0>>
<span class="journal-count">Total entries: <<print $journalEntries.length>></span>
<</if>>
</div>
<div id="journal-list">
<<if $journalEntries.length eq 0>>
<p class="empty-journal">The pages are blank... go make history!</p>
<<else>>
<<for _i = 0; _i lt $journalEntries.length; _i++>>
<<set _entry to $journalEntries[_i]>>
<div class="journal-entry importance-<<print _entry.importance>>" @data-type="_entry.type" @data-importance="_entry.importance" @data-timestamp="_entry.timestamp">
<div class="journal-header">
<span class="journal-icon">
<<if _entry.type eq "grudge">>⚔️
<<elseif _entry.type eq "sex">>❤️🔥
<<elseif _entry.type eq "combat">>⚔️
<<elseif _entry.type eq "reputation">>📢
<<elseif _entry.type eq "breakthrough">>🌊
<<elseif _entry.type eq "cultivation">>🧘
<<elseif _entry.type eq "story">>📜
<<elseif _entry.type eq "mission">>📋
<<else>>📖<</if>>
</span>
<span class="journal-title"><<print _entry.title>></span>
<span class="journal-date">
<<if _entry.age>>
Age <<print _entry.age>>
<<else>>
Turn <<print _entry.turn>>
<</if>>
</span>
</div>
<div class="journal-description">
<<print _entry.description>>
<<if _entry.location>>
<br><span class="journal-location">📍 <<print _entry.location>></span>
<</if>>
</div>
<<if _entry.relatedNPCName>>
<div class="journal-related">
👤 <<if _entry.relatedNPC and !$known_npc_list.find(function(n) { return n.id === _entry.relatedNPC and n.isDead; })>>
<<link _entry.relatedNPCName "RelationsDetailed">>
<<set $selectedNPCid to _entry.relatedNPC>>
<</link>>
<<else>>
<<print _entry.relatedNPCName>>
<<if $known_npc_list.find(function(n) { return n.id === _entry.relatedNPC and n.isDead; })>>
<span class="dead-tag">(Deceased)</span>
<</if>>
<</if>>
</div>
<</if>>
</div>
<</for>>
<</if>>
</div>
<div class="journal-footer">
<<link "Back" $passage>><</link>>
</div>
</div>
<<script>>
/* Debug version: logs data-type of each entry to browser console */
$(document).ready(function() {
var $typeSelect = $('#journal-filter-type');
var $sortSelect = $('#journal-sort');
if (!$typeSelect.length || !$sortSelect.length) return;
function filterAndSort() {
var type = $typeSelect.val();
var sort = $sortSelect.val();
var $entries = $('.journal-entry');
/* Log each entry's data-type to help debug filtering */
console.log("Selected filter: " + type);
$entries.each(function() {
console.log(" Entry data-type: " + $(this).data('type'));
});
/* Filter by type (show/hide) */
$entries.each(function() {
var $entry = $(this);
if (type === 'all' || $entry.data('type') === type) {
$entry.show();
} else {
$entry.hide();
}
});
/* Get visible entries */
var visible = $entries.filter(':visible').toArray();
/* Sort visible by selected criteria */
if (sort === 'newest') {
visible.sort(function(a, b) {
return $(b).data('timestamp') - $(a).data('timestamp');
});
} else if (sort === 'oldest') {
visible.sort(function(a, b) {
return $(a).data('timestamp') - $(b).data('timestamp');
});
} else if (sort === 'importance') {
visible.sort(function(a, b) {
return $(b).data('importance') - $(a).data('importance');
});
}
/* Reorder DOM: detach all entries, then append visible in order, then hidden */
var $allEntries = $('.journal-entry');
$allEntries.detach();
var $container = $('#journal-list');
visible.forEach(function(entry) {
$container.append(entry);
});
/* Append hidden entries after visible (so they stay in container but are hidden) */
$entries.filter(':hidden').each(function() {
$container.append(this);
});
}
$typeSelect.on('change', filterAndSort);
$sortSelect.on('change', filterAndSort);
filterAndSort(); /* initial filter & sort */
});
<</script>>
<</nobr>><<set $playeriteminventory to []>>
<<set $playeriteminventorybaselimit to 35>>
<<set $playerstashinventory to []>>
<<set $playerpotioninventory to []>>
<<set $playerspecialskill to []>>
<<set $playerpassiveskill to []>>
<<set $playerattackskill to []>>
<<set $knownRecipes = []>>
<<set $pcsidemissions = []>>
<<set $craft = false>>
<<set $spiritpavilion to 0>>
<<set $journalEntries = []>>
<<set $nextJournalId = 0>>
<<set $realmIndexMap = {
"Mortal": { "": 0 },
"Body Tempering Realm": 1,
"Meridian Awakening Realm": 2,
"Qi Condensation Realm": 3,
"Foundation Establishment Realm": 4,
"Core Formation Realm": 5,
"Nascent Soul Realm": 6
}>>
<<set $stageIndexMap = {
"Early": 0,
"Middle": 1,
"Late": 2
}>>
<<set $cultivationRealms = ["Body Tempering Realm", "Meridian Awakening Realm", "Qi Condensation Realm", "Foundation Establishment Realm", "Core Formation Realm", "Nascent Soul Realm"]>>
<<set $cultivationStages = ["Early", "Middle", "Late"]>>
<<set $realmIndex = $realmIndexMap[$cultivationRealm]>>
<<set $stageIndex = $stageIndexMap[$cultivationStage]>>
<<set $requiredExp = 1000 * (1 + $realmIndexMap[$cultivationRealm]) * (1 + $stageIndexMap[$cultivationStage])>>
<<set $relationPage to 1>>
/* ITEMS */
/* ==================== OUTER ROBES ==================== */
<<set $simplerobes to {
name: "Simple Robes",
description: "Plain yet comfortable robes woven from spirit cotton. Light and easy to move in.",
stats: { agility: 1, willpower: 1, armor: 3 },
price: 80,
sellprice: 20,
class: "robe",
durability: 100,
maxDurability: 100,
corruptionLock: 0
}>>
<<set $travelerscloak to {
name: "Traveler's Cloak",
description: "A sturdy hooded cloak that shields against wind and minor qi fluctuations.",
stats: { willpower: 2, armor: 4 },
price: 150,
sellprice: 35,
class: "robe",
durability: 120,
maxDurability: 120,
corruptionLock: 0
}>>
<<set $cloudsilkgown to {
name: "Cloud-Silk Gown",
description: "Light as mist, this flowing gown allows qi to circulate freely through the body.",
stats: { agility: 2, willpower: 3, armor: 3 },
price: 320,
sellprice: 80,
class: "robe",
durability: 90,
maxDurability: 90,
corruptionLock: 0
}>>
<<set $phoenixfeatherrobe to {
name: "Phoenix Feather Robe",
description: "Soft crimson feathers shimmer faintly. Grants minor resistance to fire qi.",
stats: { strength: 1, agility: 1, willpower: 4, armor: 5 },
price: 680,
sellprice: 170,
class: "robe",
durability: 110,
maxDurability: 110,
corruptionLock: 0
}>>
<<set $nakedState to {
name: "Naked State",
description: "No robes or protection - bare skin exposed to the elements and prying eyes. A bold choice for the corrupted.",
stats: {},
price: 0,
sellprice: 0,
class: "naked",
corruptionLock: 95,
equipped: false,
durability: 0,
maxDurability: 0
}>>
/* ==================== UNDERWEAR ==================== */
<<set $silkunderrobe to {
name: "Silk Underrobe",
description: "Smooth silk worn beneath outer robes. Simple and comfortable.",
stats: { healthRecovery: 0.02 }, /* +2% health recovery */
price: 50,
sellprice: 10,
class: "underwear",
corruptionLock: 0
}>>
<<set $jadelotuslingerie to {
name: "Jade Lotus Lingerie",
description: "Delicate jade-green silk embroidered with tiny lotuses. Enhances yin essence flow and allure.",
stats: { agility: 1, charisma: 3 },
price: 280,
sellprice: 70,
class: "underwear",
lewd: true,
corruptionLock: 0
}>>
<<set $crimsonphoenixpanties to {
name: "Crimson Phoenix Panties",
description: "Fiery red silk that warms the lower dantian. Increases sensitivity and agility.",
stats: { agility: 2, pleasureBonus: 5 },
price: 220,
sellprice: 55,
class: "underwear",
lewd: true,
corruptionLock: 0
}>>
<<set $moonlightveil to {
name: "Moonlight Veil Underwear",
description: "Nearly transparent silver threads. Calms the mind and boosts willpower during intimate moments.",
stats: { willpower: 3 },
price: 350,
sellprice: 85,
class: "underwear",
lewd: true,
corruptionLock: 0
}>>
<<set $noUnderwear to {
name: "No Underwear",
description: "Wearing robes without undergarments - a daring and slightly indecent freedom that stirs dark desires.",
stats: {},
price: 0,
sellprice: 0,
class: "underwear",
corruptionLock: 45,
equipped: false,
durability: 0,
maxDurability: 0
}>>
/* ==================== ACCESSORIES ==================== */
<<set $jadehairpin to {
name: "Jade Hairpin",
description: "A simple jade hairpin that keeps stray thoughts at bay.",
stats: { willpower: 2, insight: 1 },
price: 120,
sellprice: 30,
class: "accessory"
}>>
<<set $spiritbellanklet to {
name: "Spirit Bell Anklet",
description: "Tiny silver bells chime softly with every step, sharpening footwork.",
stats: { agility: 3 },
price: 180,
sellprice: 45,
class: "accessory"
}>>
<<set $goldenwaistchain to {
name: "Golden Waist Chain",
description: "A delicate chain that rests on the hips. Visible when robes are torn—draws admiring glances.",
stats: { agility: 1, willpower: 1, armor: 1, charisma: 3 },
price: 250,
sellprice: 60,
class: "accessory",
lewd: true
}>>
<<set $phoenixtearnecklace to {
name: "Phoenix Tear Necklace",
description: "A single glowing tear said to contain phoenix essence. Greatly strengthens resolve.",
stats: { willpower: 4 },
price: 400,
sellprice: 100,
class: "accessory"
}>>
<<set $silkstockings to {
name: "Silk Stockings",
description: "Sheer black silk that clings to the legs.",
stats: { agility: 2, charisma: 4 },
price: 300,
sellprice: 75,
class: "accessory",
lewd: true
}>>
/* ==================== WEAPONS ==================== */
<<set $ironspiritsword to {
name: "Iron Spirit Sword",
description: "A reliable sword forged from spirit iron. Balanced and easy to wield.",
stats: { atk: 6 },
price: 200,
sellprice: 50,
class: "weapon"
}>>
<<set $crimsonlotussword to {
name: "Crimson Lotus Sword",
description: "Elegant blade with a crimson edge. Leaves trails of fiery lotus petals when swung.",
stats: { atk: 10, crit: 3 },
price: 450,
sellprice: 110,
class: "weapon"
}>>
<<set $jadewhip to {
name: "Jade Serpent Whip",
description: "Flexible whip carved from spirit jade. Perfect for binding foes—or playful teasing.",
stats: { atk: 8, agility: 4 },
price: 380,
sellprice: 95,
class: "weapon",
lewd: true
}>>
/* ==================== WEAPONS ==================== */
<<set $ironspiritsword to {"name": "Iron Spirit Sword","strength": 0, "agility": 0, "willpower": 0, "armor": 0, "price": 200, "sellprice": 50, "class": "weapon", "ability": 0, "description": "A reliable sword forged from spirit iron. Balanced and easy to wield.", "stats": {"atk": 15}}>>
<<set $crimsonlotussword to {"name": "Crimson Lotus Sword","strength": 0, "agility": 0, "willpower": 0, "armor": 0, "price": 450, "sellprice": 110, "class": "weapon", "ability": 0, "description": "Elegant blade with a crimson edge. Leaves trails of fiery lotus petals when swung.", "stats": {"atk": 25, "crit": 8}}>>
<<set $jadewhip to {"name": "Jade Serpent Whip","strength": 0, "agility": 0, "willpower": 0, "armor": 0, "price": 380, "sellprice": 95, "class": "weapon", "ability": 0, "description": "Flexible whip carved from spirit jade. Perfect for binding foes—or playful teasing.", "stats": {"atk": 20, "agility": 10}}>>
<<set $phoenixfan to {"name": "Phoenix Feather Fan","strength": 0, "agility": 0, "willpower": 0, "armor": 0, "price": 520, "sellprice": 130, "class": "weapon", "ability": 0, "description": "A beautiful folding fan made of phoenix feathers. Strikes release waves of scorching qi.", "stats": {"atk": 22, "crit": 12}}>>
/* EQUIPMENT SYSTEM */
<<set $equippedRobe to null>>
<<set $equippedUnderwear to null>>
<<set $equippedWeapon to null>>
<<set $equippedAccessories to [null, null, null]>>
<<set $robeInventory to []>>
<<set $underwearInventory to []>>
<<set $accessoryInventory to []>>
<<set $weaponInventory to []>>
/* ADD STARTER ITEMS */
<<set $robeInventory.push($cloudsilkgown, $nakedState)>>
<<set $underwearInventory.push($silkunderrobe, $noUnderwear)>>
<<set $accessoryInventory.push($jadehairpin, $silkstockings)>>
<<set $weaponInventory.push($ironspiritsword)>>
<<set $equippedRobe to $cloudsilkgown>>
<<set $equippedUnderwear to $silkunderrobe>>
<<set $equippedAccessories[0] to $jadehairpin>>
<<set $equippedAccessories[1] to $silkstockings>>
<<set $equippedWeapon to $ironspiritsword>><<nobr>>
<div style="position: relative; width: 70%; height: auto;">
<<BackgroundHandler>>
<img src="images/Story/meditation.png" style="width: 50%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">
</div>
<</nobr>>
You close your eyes and begin circulating your internal energy.
Qi flows through your meridians, washing over blockages and strengthening your foundation.
Minutes pass. Then hours.
As the spiritual energy around you fades, you open your eyes — your cultivation has progressed.
This opportunity is now gone, and the land feels... ordinary again.
<<set _gain to random(50, 250)>>
<<set $exp += _gain>>
You gain <<print _gain>> experience points!
<<return "Return!">><<if $corruption >= $equippedRobe.corruptionLock and $corruption >= $equippedUnderwear.corruptionLock>>
<<link "Go back" $passage>><</link>>
<<else>>
<i>I should probably put some clothes on ...</i>
<</if>>
<<nobr>>
<div class="skills-container">
<div class="skills-header">
<h2>Your Divine Techniques</h2>
<p>Secret arts and martial profundities forged on your path to ascension.</p>
</div>
<!-- Equipped Skills Slots -->
<div class="equipped-slots">
<div class="equipped-slot">
<div class="slot-title">Special Technique</div>
<div class="slot-content">
<<if $activeSpecialSkill neq "">>
<<print $activeSpecialSkill>>
<<link "Unequip" "Skills">>
<<for _j = 0; _j < $skillInventory.length; _j++>>
<<if $skillInventory[_j].name is $activeSpecialSkill>>
<<set $skillInventory[_j].isEquipped to false>>
<</if>>
<</for>>
<<set $activeSpecialSkill to "">>
<</link>>
<<else>>
<span style="color:#819ca9; font-style:italic;">None equipped</span>
<</if>>
</div>
</div>
<div class="equipped-slot">
<div class="slot-title">Passive Art</div>
<div class="slot-content">
<<if $activePassiveSkill neq "">>
<<print $activePassiveSkill>>
<<link "Unequip" "Skills">>
<<for _j = 0; _j < $skillInventory.length; _j++>>
<<if $skillInventory[_j].name is $activePassiveSkill>>
<<set $skillInventory[_j].isEquipped to false>>
<</if>>
<</for>>
<<set $activePassiveSkill to "">>
<<set $activePassiveWidget to "">>
<<set $activePassiveLevel to 0>>
<</link>>
<<else>>
<span style="color:#819ca9; font-style:italic;">None equipped</span>
<</if>>
</div>
</div>
<div class="equipped-slot">
<div class="slot-title">Martial Skill</div>
<div class="slot-content">
<<if $activeAttackSkill neq "">>
<<print $activeAttackSkill>>
<<link "Unequip" "Skills">>
<<for _j = 0; _j < $skillInventory.length; _j++>>
<<if $skillInventory[_j].name is $activeAttackSkill>>
<<set $skillInventory[_j].isEquipped to false>>
<</if>>
<</for>>
<<set $activeAttackSkill to "">>
<</link>>
<<else>>
<span style="color:#819ca9; font-style:italic;">None equipped</span>
<</if>>
</div>
</div>
<div class="equipped-slot">
<div class="slot-title">Dao imprint</div>
<div class="slot-content">
<<if $activeDaoImprint neq "">>
<<print $activeDaoImprint>>
<<else>>
<span style="color:#819ca9; font-style:italic;">You don't have any dao imprint!</span>
<</if>>
</div>
</div>
</div>
<!-- Category Tabs -->
<<if !$skillFilter>><<set $skillFilter to "passive">><</if>>
<div class="skill-tabs">
<<link "Passive Arts" "Skills">><<set $skillFilter to "passive">><<replace ".skill-tabs">><</replace>><<replace ".skills-table">><</replace>><</link>>
<<link "Special Techniques" "Skills">><<set $skillFilter to "special">><<replace ".skill-tabs">><</replace>><<replace ".skills-table">><</replace>><</link>>
<<link "Martial Skills" "Skills">><<set $skillFilter to "attack">><<replace ".skill-tabs">><</replace>><<replace ".skills-table">><</replace>><</link>>
</div>
<!-- Skills Table -->
<table class="skills-table">
<thead>
<tr>
<th>Technique</th>
<th>Description</th>
<th style="width:120px; text-align:center;">Level</th>
</tr>
</thead>
<tbody>
<<for _i = 0; _i < $skillInventory.length; _i++>>
<<set _skill = $skillInventory[_i]>>
<<if _skill.category is $skillFilter>>
<<capture _skill>>
<tr class="skill-row">
<td>
<div class="skill-name"><<print _skill.name>></div>
<<if (_skill.category is "special" and $activeSpecialSkill is _skill.name) or
(_skill.category is "passive" and $activePassiveSkill is _skill.name) or
(_skill.category is "attack" and $activeAttackSkill is _skill.name)>>
<span class="equipped-badge">Currently Equipped</span>
<<else>>
<<link "Equip" "Skills">>
<<if _skill.category is "special">>
<<for _j = 0; _j < $skillInventory.length; _j++>>
<<if $skillInventory[_j].category is "special">>
<<set $skillInventory[_j].isEquipped to false>>
<</if>>
<</for>>
<<set _skill.isEquipped to true>>
<<set $activeSpecialSkill to _skill.name>>
<<elseif _skill.category is "passive">>
<<for _j = 0; _j < $skillInventory.length; _j++>>
<<if $skillInventory[_j].category is "passive">>
<<set $skillInventory[_j].isEquipped to false>>
<</if>>
<</for>>
<<set _skill.isEquipped to true>>
<<set $activePassiveSkill to _skill.name>>
<<set $activePassiveWidget to _skill.widgetname>>
<<set $activePassiveLevel to _skill.level>>
<<elseif _skill.category is "attack">>
<<for _j = 0; _j < $skillInventory.length; _j++>>
<<if $skillInventory[_j].category is "attack">>
<<set $skillInventory[_j].isEquipped to false>>
<</if>>
<</for>>
<<set _skill.isEquipped to true>>
<<set $activeAttackSkill to _skill.name>>
<</if>>
<<replace ".equipped-slots">><</replace>>
<<replace ".skills-table">><</replace>>
<</link>>
<</if>>
</td>
<td><<print _skill.description>></td>
<td class="skill-level"><<print _skill.level>></td>
</tr>
<</capture>>
<</if>>
<</for>>
</tbody>
</table>
<<if $skillInventory.filter(s => s.category is $skillFilter).length eq 0>>
<p style="text-align:center; color:#819ca9; font-style:italic; margin:40px 0;">
No techniques of this category have been learned yet.
</p>
<</if>>
</div>
<</nobr>><<set $activeSpecialSkill to "">>
<<set $activePassiveSkill to "">>
<<set $activeAttackSkill to "">>
<<set $skillFilter = "passive">>
<<set $skillInventory to []>>
<!-- Special Skill -->
<<set $soulflareReversal to {
"name": "Soulflare Reversal",
"skillid": "soulflareReversal",
"widgetname": "SoulflareReversal",
"isEquipped": "false",
"energy": 90,
"exp": 400,
"level": 1,
"levelexp": 500,
"levelenergy": -10,
"category": "special",
"description": "Burn your own soul essence to reverse a fatal blow, instantly healing a portion of your health and negating death once per battle.",
"leveldescription": "Cooldown is reduced. At higher levels, also reflects part of the damage back to the attacker."
}>>
<<set $skyPiercer to {
"name": "Sky Piercer",
"skillid": "skyPiercer",
"widgetname": "skyPiercer",
"energy": 90,
"exp": 400,
"level": 1,
"levelexp": 500,
"levelenergy": -10,
"category": "special",
"description": "Pierce the heavens with a blade of Qi, dealing damage to all enemies and ignoring their barriers.",
"leveldescription": "Increases range and critical hit chance by 15%."
}>>
<<set $dragonSoulBurst to {
"name": "Dragon Soul Burst",
"skillid": "dragonSoulBurst",
"widgetname": "dragonSoulBurst",
"energy": 95,
"exp": 420,
"level": 1,
"levelexp": 520,
"levelenergy": -12,
"category": "special",
"description": "Unleash the essence of a dragon's soul, enhancing all attributes for 3 turns.",
"leveldescription": "Duration increases to 4 turns and buffs gain an additional 10% effect."
}>>
<!-- Passive Skill -->
<<set $stoneheartConstitution to {
"name": "Stoneheart Constitution",
"skillid": "stoneheartConstitution",
"widgetname": "StoneheartConstitution",
"isEquipped": "false",
"energy": 0,
"exp": 250,
"level": 1,
"levelexp": 350,
"levelenergy": 0,
"category": "passive",
"description": "Your body is tempered like jade and stone. Increases base defense and resistance to physical damage.",
"leveldescription": "Boosts passive defense further. At high levels, grants minor immunity to bleed and fracture effects."
}>>
<<set $flowingQi to {
"name": "Flowing Qi",
"skillid": "flowingQi",
"widgetname": "flowingQi",
"energy": 0,
"exp": 250,
"level": 1,
"levelexp": 350,
"levelenergy": 0,
"category": "passive",
"description": "Your Qi flows naturally — regenerate 5 energy each turn.",
"leveldescription": "Regeneration increases to 8 energy per turn."
}>>
<<set $ironMeridians to {
"name": "Iron Meridians",
"skillid": "ironMeridians",
"widgetname": "ironMeridians",
"energy": 0,
"exp": 300,
"level": 1,
"levelexp": 400,
"levelenergy": 0,
"category": "passive",
"description": "Your meridians harden like steel — reduce all incoming damage by 10%.",
"leveldescription": "Damage reduction increases to 15%."
}>>
<!-- Attack Skill -->
<<set $heavenSplittingPalm to {
"name": "Heaven-Splitting Palm",
"skillid": "heavenSplittingPalm",
"widgetname": "HeavenSplittingPalm",
"isEquipped": "false",
"energy": 60,
"exp": 300,
"level": 1,
"levelexp": 400,
"levelenergy": -5,
"category": "attack",
"description": "A devastating palm strike that channels spiritual force into raw destructive power. Ignores part of the enemy's defense.",
"leveldescription": "Damage increases with each level. High levels may cause 'stagger' or break enemy defense stance."
}>>
<<set $crimsonSlash to {
"name": "Crimson Slash",
"skillid": "crimsonSlash",
"widgetname": "crimsonSlash",
"energy": 60,
"exp": 300,
"level": 1,
"levelexp": 400,
"levelenergy": -5,
"category": "attack",
"description": "A swift, deadly slash infused with spiritual fire — deals extra fire damage.",
"leveldescription": "Increases fire damage by 20% and adds a chance to burn the enemy."
}>>
<<set $phantomPalm to {
"name": "Phantom Palm",
"skillid": "phantomPalm",
"widgetname": "phantomPalm",
"energy": 50,
"exp": 270,
"level": 1,
"levelexp": 380,
"levelenergy": -4,
"category": "attack",
"description": "Strike with a wave of spiritual energy, dealing damage and potentially knocking the enemy back.",
"leveldescription": "Increases knockback chance and adds minor mental damage."
}>>
<!-- Dao Imprint -->
<<set $devouringessence to {
"name": "Devouring Essence",
"skillid": "devouringessence",
"widgetname": "DevouringEssence",
"isEquipped": "true",
"energy": 0,
"exp": 0,
"level": 1,
"levelexp": 300,
"levelenergy": 0,
"category": "dao",
"statStealChance": 5, /* 5% chance to steal a base stat at Level 1 */
"description": "The mark of one who feeds upon the Dao itself. Your spirit asserts dominion over weaker foundations, forcibly claiming Qi, vitality, and latent potential. Where others cultivate, you harvest.",
"leveldescription": "Actively drains 5% of a target’s Qi and Health, permanently increasing your Max Qi and Max Health. At Level 1, there is a 5% chance to permanently seize 1 point of a random Base Stat from the victim. Higher levels increase drain efficiency and the chance to claim deeper aspects of their foundation."
}>>
<<set $harmonizedessence to {
"name": "Harmonized Essence",
"skillid": "harmonizedessence",
"widgetname": "HarmonizedEssence",
"isEquipped": "true",
"energy": 0,
"exp": 0,
"level": 1,
"levelexp": 300,
"levelenergy": 0,
"category": "dao",
"statGainChance": 3, /* Lower chance than evil, but 'clean' and safe */
"description": "The mark of one aligned with the greater cycle. Your spirit resonates with Heaven’s rhythm, refining excess and discordant energies into stable growth. Nothing is stolen; all is returned in balance.",
"leveldescription": "Passively refines 5% of ambient and encounter-generated energy into permanent increases to Max Qi and Max Health, without harming others. At Level 1, there is a 3% chance to gain 1 point of a random Base Stat through sudden Dao insight. Higher levels improve refinement efficiency and the frequency of enlightenment."
}>>
<!--__________________________________________________________________________________________
__________________________________________________________________________________________!-->
<set $abc1 to {
"name": "abc1",
"skillid": "abc1",
"widgetname": "abc1",
"energy": 90,
"exp": 400,
"level": 1,
"levelexp": 500,
"levelenergy": -10,
"category": "special",
"description": "abc1",
"leveldescription": "abc1"
}>>
<-- Passive Skill -->
<<set $abc2 to {
"name": "abc2",
"skillid": "abc2",
"widgetname": "abc2",
"energy": 0,
"exp": 250,
"level": 1,
"levelexp": 350,
"levelenergy": 0,
"category": "passive",
"description": "abc2",
"leveldescription": "abc2"
}>>
<-- Attack Skill -->
<<set $abc3 to {
"name": "abc3",
"skillid": "abc3",
"widgetname": "abc3",
"energy": 60,
"exp": 300,
"level": 1,
"levelexp": 400,
"levelenergy": -5,
"category": "attack",
"description": "abc3",
"leveldescription": "abc3"
}>>
__________________________________________________________________________________________
<<set $sectRanks = ["Initiate", "Disciple", "Inner Disciple", "Core Disciple", "True Disciple", "Elder", "Great Elder", "Sect Leader"]>>
<<set $sectManuals to []>>
<<set $sectManuals to {
"righteous": {
"Initiate": [
{
"name": "Falling Star Palm",
"skillid": "fallingStarPalm",
"widgetname": "FallingStarPalm",
"isEquipped": "false",
"energy": 30,
"exp": 0,
"level": 1,
"levelexp": 300,
"levelenergy": -5,
"category": "attack",
"description": "A palm strike that descends like a falling star, striking with explosive force.",
"leveldescription": "Deals splash damage to nearby enemies.",
"ContributionPointCost": 60
},
{
"name": "Radiant Lotus Technique",
"skillid": "radiantLotus",
"widgetname": "RadiantLotus",
"isEquipped": "false",
"energy": 0,
"exp": 0,
"level": 1,
"levelexp": 400,
"levelenergy": 0,
"category": "passive",
"description": "Your presence exudes righteous qi, increasing healing effects and inner clarity.",
"leveldescription": "Further enhances healing and energy regeneration.",
"ContributionPointCost": 50
},
{
"name": "Heavenward Barrier",
"skillid": "heavenwardBarrier",
"widgetname": "HeavenwardBarrier",
"isEquipped": "false",
"energy": 90,
"exp": 400,
"level": 1,
"levelexp": 500,
"levelenergy": -10,
"category": "special",
"description": "Conjure a celestial shield that blocks a single fatal blow and restores health.",
"leveldescription": "Shorter cooldown and partial damage reflection at higher levels.",
"ContributionPointCost": 75
}
],
"Disciple": [
{
"name": "Soulflare Reversal",
"skillid": "soulflareReversal",
"widgetname": "SoulflareReversal",
"isEquipped": "false",
"energy": 90,
"exp": 400,
"level": 1,
"levelexp": 500,
"levelenergy": -10,
"category": "special",
"description": "Burn your own soul essence to reverse a fatal blow, instantly healing a portion of your health and negating death once per battle.",
"leveldescription": "Cooldown is reduced. At higher levels, also reflects part of the damage back to the attacker."
}
],
"elder": []
},
"demonic": {
"Initiate": [
{
"name": "Venom Fang Slash",
"skillid": "venomFangSlash",
"widgetname": "VenomFangSlash",
"isEquipped": "false",
"energy": 35,
"exp": 0,
"level": 1,
"levelexp": 300,
"levelenergy": -5,
"category": "attack",
"description": "A vicious claw strike infused with poison, dealing extra damage over time.",
"leveldescription": "Increased poison duration and critical hit chance.",
"ContributionPointCost": 60
},
{
"name": "Unholy Endurance",
"skillid": "unholyEndurance",
"widgetname": "UnholyEndurance",
"isEquipped": "false",
"energy": 0,
"exp": 0,
"level": 1,
"levelexp": 400,
"levelenergy": 0,
"category": "passive",
"description": "Dark cultivation techniques harden your body, granting resistance to pain and weakening.",
"leveldescription": "Further boosts defense and resistance to negative effects.",
"ContributionPointCost": 50
},
{
"name": "Blood Curse Mark",
"skillid": "bloodCurseMark",
"widgetname": "BloodCurseMark",
"isEquipped": "false",
"energy": 100,
"exp": 400,
"level": 1,
"levelexp": 500,
"levelenergy": -15,
"category": "special",
"description": "Sacrifice your own blood to curse an enemy. Reduces their healing and increases damage taken.",
"leveldescription": "Longer curse duration and chance to spread to nearby foes.",
"ContributionPointCost": 75
}
],
"Dsciple": [],
"Elder": []
}
}>>--------------------------------------GENERAL---------------------------------------------
<<set $MapRegion to "Region1">>
<!-- interaction calcul -->
<<set $power = {
"Mortal": { "": 0 },
"Body Tempering Realm": { "Early": 10, "Middle": 11, "Late": 12 },
"Meridian Awakening Realm": { "Early": 20, "Middle": 21, "Late": 22 },
"Qi Condensation Realm": { "Early": 30, "Middle": 31, "Late": 32 },
"Foundation Establishment Realm": { "Early": 40, "Middle": 41, "Late": 42 },
"Core Formation Realm": { "Early": 50, "Middle": 51, "Late": 52 },
"Nascent Soul Realm": { "Early": 60, "Middle": 61, "Late": 62 }
}>>
<!-- General stats -->
<<set $lifespan to 18>>
<<set $basemaxlifespan to 80>>
<<set $health to 300>>
<<set $basemaxhealth to 300>>
<<set $energy to 200>>
<<set $basemaxenergy to 200>>
<<set $baseluck to 5>>
<<set $baseinsight to 5>>
<<set $passiveatk to 0>>
<<set $passivedef to 0>>
<<set $passivecrit to 0>>
<<set $passivecritres to 0>>
<<set $passiveagility to 0>>
<<set $baseatk to 50>>
<<set $basedef to 5>>
<<set $basecrit to 3>>
<<set $basecritres to 1>>
<<set $baseagility to 7>>
<<set $basemartialArts to 10>>
<<set $basespiritualRoot to 10>>
<<set $basewillpower to 5>>
<<set $basestrength to 5>>
<<set $basecharisma to 5>>
<<set $energyRecovery = $basewillpower/100>>
<<set $healthRecovery = $basestrength/100>>
<<set $destinyatk = 0>>
<<set $destinydef = 0>>
<<set $destinycrit = 0>>
<<set $destinycritres = 0>>
<<set $destinyagility = 0>>
<<set $destinymartialArts = 0>>
<<set $destinyspiritualRoot = 0>>
<<set $destinylifespan to 0>>
<<set $destinyenergy to 0>>
<<set $destinyhealth to 0>>
<<set $atk = $baseatk + $destinyatk + ($basestrength*0.5) + $passiveatk>>
<<set $def = $basedef + $destinydef + $passivedef>>
<<set $crit = $basecrit + $destinycrit + $passivecrit>>
<<set $critres = $basecritres + $destinycritres + $passivecritres>>
<<set $agility = $baseagility + $destinyagility + $passiveagility>>
<<set $martialArts = $basemartialArts + $destinymartialArts>>
<<set $spiritualRoot = $basespiritualRoot + $destinyspiritualRoot>>
<<set $luck to $baseluck>>
<<set $insight to $baseinsight>>
<<set $evadescore = ($agility * 2) + ($insight * 1.5) + ($luck * 0.5)>>
<<set $maxlifespan to $basemaxlifespan + $destinylifespan>>
<<set $maxhealth to $basemaxhealth + $destinyenergy>>
<<set $maxenergy to $basemaxenergy + $destinyhealth>>
reputation -> WIDGET
<<set $charisma to $basecharisma>>
<<set $cultivationRealm to "Body Tempering Realm">>
<<set $cultivationStage to "Early">>
<<set $playerPower = $power[$cultivationRealm][$cultivationStage]>>
<<set $exp to 0>>
<<set $verystart to 0>>
<<set $gold to 0>>
<<set $lastRecoveryTurn = 0>>
<!--------------------------------------NSFW------------------------------------------------>
<<set $corruption to 0>> ->corruption
<<set $virginity to 1>> *if 1 then pc is virgin, else not*
<<set $virginityLost to "">>*with who pc lost virginity*
<<set $analVirginity to 1>>*if 1 then pc is virgin, else not*
<<set $analVirginityLost to "">> *with who pc lost virginity*
<<set $achievements = []>> <!-- Stores unlocked achievements -->
<<set $arousal = 0>>
<<set $maxArousal = 100>>
<!--------------------------------------MAP------------------------------------------------>
<<set $currentRegion to "Region1">>
<<set $sidemission to "inactive">>
<<set $sidemissionX to 0>>
<<set $sidemissionY to 0>>
<<set $totalTurns to 0>>
<<set $turns = 0>>
<<set $turnsPerYear = 24>>
<!---------------------------------------------REPUTATION---------------------------------->
<<set $righteousreputation to 0>>
<<set $demonicreputation to 0>>
<<set $PCrighteousreputation to 0>>
<<set $PCdemonicreputation to 0>>
<<set $totalPCrighteousreputation to $PCrighteousreputation + $righteousreputation>>
<<set $totalPCdemonicreputation to $PCdemonicreputation + $demonicreputation>>
<<set $publicReputation to 0>>
<<set $hiddenReputation to 0>>
<<set $sectSuspicion to 0>>
<<set $fame to 0>>
<<set $sexFame to 0>>
<<set $combatFame to 0>>
<<set $cultivationFame to 0>>
<<set $sectFame to 0>>
<<set $totalFame to ($fame + $sectFame + $cultivationFame + $combatFame)>>
<!--------------------------------------MAIN PLOT------------------------------------------------>
<<set $mainStage0choice to "">>
<<set $activeDaoImprint to "">>
<<set $storyEvent to {
active: false,
x: null,
y: null,
stage: null,
duration: 0,
cooldown: 0
}>>
<!---------------------------------Player family------------------------------------------------->
<<if !$playerRelations>>
<<set $playerRelations = {
parents: [],
siblings: [],
children: [],
spouses: [],
lovers: [],
exes: [], /* NEW */
masters: [],
apprentices: [],
rivals: [] /* NEW */
}>>
<</if>>
<!--------------------------------------MISCELLANEOUS------------------------------------------------>
<<set $playerfullname to "$playername" + " " + "$playersurname">>
<<set $civilians_harmed to 0>>
<<set $hypocrisyScore to 0>>
<<set $sectLawPressure to 0>>
<<set $sectInvestigationLevel to 0>>
<<set $dualCultivationCount to 0>>
<<set $drainingActs to 0>>
<<set $consensualDualCultivation to 0>>
<<set $forcedExtraction to 0>>
<!--------------------------------------Sect Information------------------------------------------------>
<<set $CurrentPcSectRank to "">>
<<set $CurrentPcSectReputation to 0>>
<<set $CurrentPcSect to "">>
<<set $CurrentPcAffiliation to "">>
<<set $CurrentPcMainSect to "">>
<<set $ContributionPoints to 0>>
<<set $sectFavor to 0>>
<<set $CurrentPcSectRank = ["Initiate", "Disciple", "Inner Disciple", "Core Disciple", "True Disciple", "Elder", "Great Elder", "Sect Leader"]>>
<!--------------------------------------METERS------------------------------------------------>
<<newmeter 'health' 1>>
<<sizing '220px' '25px'>>
<<label "HP: $health / $maxhealth" 'black' center>>
<<colors '#2ecc71' '#e74c3c'>> /* Green to Red */
<</newmeter>>
<<newmeter 'energy' 1>>
<<sizing '220px' '25px'>>
<<label "Qi: $energy / $maxenergy" 'black' center>>
<<colors '#0377fc' '#9b59b6'>> /* Blue to Purple */
<</newmeter>>
<<newmeter 'timer' 0>>
<<colors 'red' 'green'>>
<<animation 10s linear>>
<</newmeter>><<if $corruption >= $equippedRobe.corruptionLock and $corruption >= $equippedUnderwear.corruptionLock>>
<<link "Go back" $passage>><</link>>
<<else>>
<i>I should probably put some clothes on ...</i>
<</if>>
<<StatsUpdater>>
<<if $treeVisible is undefined>>
<<set $treeVisible = false>>
<</if>>
<div style="text-align:center; margin:15px 0;">
<<if $treeVisible>>
<<link "🌳 Hide Family Tree" "Status">>
<<set $treeVisible = false>>
<</link>>
<<else>>
<<link "🌳 Show Family Tree" "Status">>
<<set $treeVisible = true>>
<<DrawPlayerTree>>
<</link>>
<</if>>
</div>
<div id="tree-container">
<<if $treeVisible>>
<<DrawPlayerTree>>
<</if>>
</div>
<<nobr>>
<div class="status-container">
<div class="status-header">
<<StatusPortrait>>
<div class="status-info">
<div><b>Surname:</b> $playersurname <b>Lifespan:</b> $lifespan / $maxlifespan</div>
<div><b>Name:</b> $playername <b>Sex:</b> Female</div>
<div><b>Charisma:</b> $charisma</div>
<div><b>Realm:</b> <span class="status-realm"><<cultivationStatus>></span></div>
<div><b>Internal Trait:</b> $internalTrait</div>
<div><b>External Trait:</b> <<print $externalTrait>></div>
<div><b>Sect Position:</b> <<print $CurrentPcSectRank>></div>
<div><b>Sect:</b> <<print $CurrentPcAffiliation>></div>
</div>
</div>
Your constitution: <span class="status-constitution"><<print $constitutionName>></span>
<br> <<link "H-status" "H-status">><</link>>
<div class="status-stats">
<!-- General Stats -->
<div class="stat-category">
<div class="category-title">General Cultivation</div>
<div class="stat-line"><span class="stat-label">🧬 Lifespan</span><span class="stat-value">$lifespan / $maxlifespan</span></div>
<div class="stat-line"><span class="stat-label">❤️ Health</span><span class="stat-value">$health / $maxhealth</span></div>
<div class="stat-line"><span class="stat-label">⚡ Energy (Qi)</span><span class="stat-value">$energy / $maxenergy</span></div>
<div class="stat-line"><span class="stat-label">🍀 Luck</span><span class="stat-value">$luck</span></div>
<div class="stat-line"><span class="stat-label">🧠 Insight</span><span class="stat-value">$insight</span></div>
<div class="stat-line"><span class="stat-label">💪 Strength</span><span class="stat-value">$basestrength</span></div>
<div class="stat-line"><span class="stat-label">🌀 Willpower</span><span class="stat-value">$basewillpower</span></div>
<div class="stat-line"><span class="stat-label">🧘♂️ Energy Recovery</span><span class="stat-value"><<print $energyRecovery * 100>>%</span></div>
</div>
<!-- Combat Stats -->
<div class="stat-category">
<div class="category-title">Combat Prowess</div>
<div class="stat-line"><span class="stat-label">🗡️ Attack</span><span class="stat-value high">$atk</span></div>
<div class="stat-line"><span class="stat-label">🛡️ Defense</span><span class="stat-value">$def</span></div>
<div class="stat-line"><span class="stat-label">💥 Critical Rate</span><span class="stat-value">$crit%</span></div>
<div class="stat-line"><span class="stat-label">🛑 Critical Resist</span><span class="stat-value">$critres%</span></div>
<div class="stat-line"><span class="stat-label">👟 Agility</span><span class="stat-value">$agility</span></div>
<div class="stat-line"><span class="stat-label">🥋 Martial Arts</span><span class="stat-value high">$martialArts</span></div>
<div class="stat-line"><span class="stat-label">🌌 Spiritual Root</span><span class="stat-value high">$spiritualRoot</span></div>
<div class="stat-line"><span class="stat-label">🩸 Health Recovery</span><span class="stat-value"><<print $healthRecovery * 100>>%</span></div>
</div>
</div>
</div>
<</nobr>><<RichQiPlace_Region1>> -> cultivation passage
<<RareHerbs_Region1>> -> rare herbs gathering<<widget "CreateNPC_Region1">>\
<<silently>>\
<<set _id = random(0, 10000) + Date.now()>>
<<set _gender = 0>>
<<set _RighteousTendencies = random(100,200)>>
<<set _DemonicTendencies = random(100,200)>>
<<set _enemyability = []>>
<<set _enemyability.push("attack", "attack")>>
<<set _name = $male_npc_names.random()>>
<<set _surname = $npc_surnames.random()>>
<<set _enemyregion = "Enemy">>
<<set _enemyimage = ["enemy1", "enemy2", "enemy3", "enemy4"].random()>>
<<set _fullname = _surname + " " + _name>>
<<set _imgID = random(0,10)>>,
<<set _location = ["Jade Creek Town", "Northern Phoenix City", "Blood Sand Reach", "Hundred Sorrows Mountain"].random()>>
<<set _stageType = ["Early", "Middle", "Late"].random()>>
<<set _realm = ["Body Tempering Realm", "Meridian Awakening Realm", "Qi Condensation Realm"].random()>>
<<set _cultivation = _realm + " " +_stageType>>
<<set _sectAffiliation = ["Clear Sky Azure Dragon Pavilion", "Ghost King Netherworld Sect"].random()>>
<<if _sectAffiliation eq "Clear Sky Azure Dragon Pavilion">><<set _enemySect to "righteous">><<else>><<set _enemySect to "demonic">><</if>>
<<set _npcmentorship = 0>>
<<set _npcRelationship = 0>>
<<if _realm eq "Body Tempering Realm">>
<<if _stageType eq "Early">>
<<set _maxlifespanNPC = random(70, 80)>>
<<set _lifespanNPC = random(18,70)>>
<<set _maxhealthNPC = random(250, 320)>>
<<set _currenthealthNPC = _maxhealthNPC>>
<<set _maxenergyNPC = random(180, 220)>>
<<set _currentenergyNPC = _maxenergyNPC>>
<<set _luckNPC = random(4, 6)>>
<<set _insightNPC = random(4, 6)>>
<<set _basestrengthNPC = random(4, 6)>>
<<set _basewillpowerNPC = random(4, 6)>>
<<set _atkNPC = random(35, 45)>>
<<set _defNPC = random(4, 6)>>
<<set _critNPC = random(2, 4)>>
<<set _critresNPC = random(1, 2)>>
<<set _agilityNPC = random(6, 8)>>
<<set _martialArtsNPC = random(8, 12)>>
<<set _spiritualRootNPC = random(9, 11)>>
<<elseif _stageType eq "Middle">>
<<set _maxlifespanNPC = random(85, 115)>>
<<set _lifespanNPC = random(18,85)>>
<<set _maxhealthNPC = random(350, 450)>>
<<set _maxenergyNPC = random(250, 320)>>
<<set _luckNPC = random(6, 10)>>
<<set _insightNPC = random(6, 10)>>
<<set _basestrengthNPC = random(7, 10)>>
<<set _basewillpowerNPC = random(6, 9)>>
<<set _atkNPC = random(45, 85)>>
<<set _defNPC = random(6, 10)>>
<<set _critNPC = random(4, 7)>>
<<set _critresNPC = random(3, 5)>>
<<set _agilityNPC = random(8, 12)>>
<<set _martialArtsNPC = random(12, 18)>>
<<set _spiritualRootNPC = random(11, 14)>>
<<elseif _stageType eq "Late">>
<<set _maxlifespanNPC = random(115, 130)>>
<<set _lifespanNPC = random(18,115)>>
<<set _maxhealthNPC = random(500, 700)>>
<<set _maxenergyNPC = random(350, 500)>>
<<set _luckNPC = random(8, 14)>>
<<set _insightNPC = random(10, 16)>>
<<set _basestrengthNPC = random(11, 15)>>
<<set _basewillpowerNPC = random(10, 14)>>
<<set _atkNPC = random(85, 120)>>
<<set _defNPC = random(12, 18)>>
<<set _critNPC = random(6, 10)>>
<<set _critresNPC = random(6, 10)>>
<<set _agilityNPC = random(12, 18)>>
<<set _martialArtsNPC = random(16, 25)>>
<<set _spiritualRootNPC = random(15, 20)>>
<</if>>
<</if>>
<<if _realm eq "Meridian Awakening Realm">>
<<if _stageType eq "Early">>
<<set _maxlifespanNPC = random(135, 140)>>
<<set _lifespanNPC = random(18,135)>>
<<set _maxhealthNPC = random(750, 900)>>
<<set _currenthealthNPC = _maxhealthNPC>>
<<set _maxenergyNPC = random(600, 720)>>
<<set _currentenergyNPC = _maxenergyNPC>>
<<set _luckNPC = random(10, 14)>>
<<set _insightNPC = random(12, 16)>>
<<set _basestrengthNPC = random(16, 20)>>
<<set _basewillpowerNPC = random(14, 18)>>
<<set _atkNPC = random(120, 170)>>
<<set _defNPC = random(20, 30)>>
<<set _critNPC = random(8, 12)>>
<<set _critresNPC = random(8, 12)>>
<<set _agilityNPC = random(16, 22)>>
<<set _martialArtsNPC = random(24, 32)>>
<<set _spiritualRootNPC = random(22, 30)>>
<<elseif _stageType eq "Middle">>
<<set _maxlifespanNPC = random(145, 150)>>
<<set _lifespanNPC = random(18,145)>>
<<set _maxhealthNPC = random(1000, 1200)>>
<<set _maxenergyNPC = random(800, 1000)>>
<<set _currenthealthNPC = _maxhealthNPC>>
<<set _currentenergyNPC = _maxenergyNPC>>
<<set _luckNPC = random(14, 20)>>
<<set _insightNPC = random(18, 24)>>
<<set _basestrengthNPC = random(20, 26)>>
<<set _basewillpowerNPC = random(18, 24)>>
<<set _atkNPC = random(170, 220)>>
<<set _defNPC = random(28, 40)>>
<<set _critNPC = random(10, 16)>>
<<set _critresNPC = random(10, 16)>>
<<set _agilityNPC = random(22, 30)>>
<<set _martialArtsNPC = random(30, 40)>>
<<set _spiritualRootNPC = random(28, 36)>>
<<elseif _stageType eq "Late">>
<<set _maxlifespanNPC = random(155, 160)>>
<<set _lifespanNPC = random(18,155)>>
<<set _maxhealthNPC = random(1400, 1800)>>
<<set _maxenergyNPC = random(1200, 1600)>>
<<set _currenthealthNPC = _maxhealthNPC>>
<<set _currentenergyNPC = _maxenergyNPC>>
<<set _luckNPC = random(20, 28)>>
<<set _insightNPC = random(26, 34)>>
<<set _basestrengthNPC = random(28, 36)>>
<<set _basewillpowerNPC = random(26, 32)>>
<<set _atkNPC = random(220, 270)>>
<<set _defNPC = random(40, 55)>>
<<set _critNPC = random(14, 20)>>
<<set _critresNPC = random(14, 20)>>
<<set _agilityNPC = random(30, 40)>>
<<set _martialArtsNPC = random(38, 50)>>
<<set _spiritualRootNPC = random(35, 45)>>
<</if>>
<</if>>
<<if _realm eq "Qi Condensation Realm">>
<<if _stageType eq "Early">>
<<set _maxlifespanNPC = random(165, 170)>>
<<set _lifespanNPC = random(18,165)>>
<<set _maxhealthNPC = random(900, 900)>>
<<set _currenthealthNPC = _maxhealthNPC>>
<<set _maxenergyNPC = random(600, 720)>>
<<set _currentenergyNPC = _maxenergyNPC>>
<<set _luckNPC = random(10, 14)>>
<<set _insightNPC = random(12, 16)>>
<<set _basestrengthNPC = random(16, 20)>>
<<set _basewillpowerNPC = random(14, 18)>>
<<set _atkNPC = random(270, 330)>>
<<set _defNPC = random(20, 30)>>
<<set _critNPC = random(8, 12)>>
<<set _critresNPC = random(8, 12)>>
<<set _agilityNPC = random(16, 22)>>
<<set _martialArtsNPC = random(24, 32)>>
<<set _spiritualRootNPC = random(22, 30)>>
<<elseif _stageType eq "Middle">>
<<set _maxlifespanNPC = random(175, 180)>>
<<set _lifespanNPC = random(18,175)>>
<<set _maxhealthNPC = random(1000, 1200)>>
<<set _maxenergyNPC = random(800, 1000)>>
<<set _currenthealthNPC = _maxhealthNPC>>
<<set _currentenergyNPC = _maxenergyNPC>>
<<set _luckNPC = random(14, 20)>>
<<set _insightNPC = random(18, 24)>>
<<set _basestrengthNPC = random(20, 26)>>
<<set _basewillpowerNPC = random(18, 24)>>
<<set _atkNPC = random(330, 380)>>
<<set _defNPC = random(28, 40)>>
<<set _critNPC = random(10, 16)>>
<<set _critresNPC = random(10, 16)>>
<<set _agilityNPC = random(22, 30)>>
<<set _martialArtsNPC = random(30, 40)>>
<<set _spiritualRootNPC = random(28, 36)>>
<<elseif _stageType eq "Late">>
<<set _maxlifespanNPC = random(185, 200)>>
<<set _lifespanNPC = random(18,185)>>
<<set _maxhealthNPC = random(1400, 1800)>>
<<set _maxenergyNPC = random(1200, 1600)>>
<<set _currenthealthNPC = _maxhealthNPC>>
<<set _currentenergyNPC = _maxenergyNPC>>
<<set _luckNPC = random(20, 28)>>
<<set _insightNPC = random(26, 34)>>
<<set _basestrengthNPC = random(28, 36)>>
<<set _basewillpowerNPC = random(26, 32)>>
<<set _atkNPC = random(370, 430)>>
<<set _defNPC = random(40, 55)>>
<<set _critNPC = random(14, 20)>>
<<set _critresNPC = random(14, 20)>>
<<set _agilityNPC = random(30, 40)>>
<<set _martialArtsNPC = random(38, 50)>>
<<set _spiritualRootNPC = random(35, 45)>>
<</if>>
<</if>>
<<set _intTrait = $NPCinternalOptions.random()>>
<<set _extTrait = $NPCexternalOptions.random()>>
<<set _friendship = 0>>
<<set _had_sex = 0>>
<<set _talk = true>>
<<set _charm = random(1, 5)>>
<<set _depravity = random(7, 30)>>
<<set _enemyEvadeScore = (_agilityNPC * 2) + (_insightNPC * 1.5) + (_luckNPC * 0.5)>>
<<set _npc = {
id: _id,
IdImg: _imgID,
name: _name,
surname: _surname,
internalTrait: _intTrait,
externalTrait: _extTrait,
friendship: _friendship,
depravity: _depravity,
charm: _charm,
talk: _talk,
hadSex: _had_sex,
mentorshipType: _npcmentorship,
relationshipType: _npcRelationship,
sectNPC: _sectAffiliation,
realm: _cultivation,
gender: _gender,
fullname: _fullname,
NPCmaxlifespan: _maxlifespanNPC,
NPClifespan: __lifespanNPC,
NPCmaxhealth: _maxhealthNPC,
NPCmaxenergy: _maxenergyNPC,
NPCcurrenthealth: _currenthealthNPC,
NPCcurrentenergy: _currentenergyNPC,
NPCluck: _luckNPC,
NPCinsight: _insightNPC,
NPCbasestrength: _basestrengthNPC,
NPCbasewillpower: _basewillpowerNPC,
NPCatk: _atkNPC,
NPCdef: _defNPC,
NPCcrit: _critNPC,
NPCcritres: _critresNPC,
NPCagility: _agilityNPC,
NPCmartialArts: _martialArtsNPC,
NPCspiritualRoot: _spiritualRootNPC,
NPClocation: _location,
enemyregion: _enemyregion,
enemyimage: _enemyimage,
enemyEvade: _enemyEvadeScore,
enemyAbility: _enemyability,
RightTendencies: _RighteousTendencies,
DemonTendencies: _DemonicTendencies,
enemySectType: _enemySect
}>>
<</silently>>\
<</widget>>\
\
\
\
\
<<widget "ArrogantYoungMaster">>
<<silently>>
<<set _id = random(10001, 20000) + Date.now()>>
<<set _name = $male_npc_names.random()>>
<<set _surname = $npc_surnames.random()>>
<<set _fullname = _surname + " " + _name>>
<<set _enemyability = []>>
<<set _enemyregion = "Enemy">>
<<set _enemyimage = ["aym", "aym2", "aym3", "aym4", "aym5", "aym6", "aym7","aym8","aym9","aym10"].random()>>
<<set _enemyability.push("attack", "attack")>>
<<set _stageType = ["Early", "Middle", "Late"].random()>>
<<if $cultivationRealm eq "Body Tempering Realm">><<set _realm = "Body Tempering Realm">><<elseif $cultivationRealm eq "Meridian Awakening Realm">>
<<set _realm = "Body Tempering Realm">><<elseif $cultivationRealm eq "Qi Condensation Realm">><<set _realm = "Meridian Awakening Realm">><</if>>
<<set _location = ["Jade Creek Town", "Northern Phoenix City", "Blood Sand Reach", "Hundred Sorrows Mountain"].random()>>
<<set _cultivation = _realm + " " +_stageType>>
<<set _sectAffiliation = $npc_sects.random()>>
<<set _maxlifespanNPC = random(85, 115)>>
<<set _lifespanNPC = random(18,25)>>
<<set _maxhealthNPC = random(350, 450)>>
<<set _maxenergyNPC = random(250, 320)>>
<<set _luckNPC = random(6, 10)>>
<<set _insightNPC = random(6, 10)>>
<<set _basestrengthNPC = random(7, 10)>>
<<set _basewillpowerNPC = random(6, 9)>>
<<set _atkNPC = random(15, 22)>>
<<set _defNPC = random(6, 10)>>
<<set _critNPC = random(4, 7)>>
<<set _critresNPC = random(3, 5)>>
<<set _agilityNPC = random(8, 12)>>
<<set _martialArtsNPC = random(12, 18)>>
<<set _spiritualRootNPC = random(11, 14)>>
<<set _friendship = 0>>
<<set _intTrait = $NPCinternalOptions.random()>>
<<set _extTrait = $NPCexternalOptions.random()>>
<<set _npc = {
id: _id,
name: _name,
enemyimage: _enemyimage,
enemyregion: _enemyregion,
surname: _surname,
internalTrait: _intTrait,
externalTrait: _extTrait,
friendship: _friendship,
depravity: _depravity,
charm: _charm,
friendship: _friendship,
talk: _talk,
hadSex: _had_sex,
mentorshipType: _npcmentorship,
relationshipType: _npcRelationship,
sectNPC: _clan,
realm: _cultivation,
gender: _gender,
fullname: _fullname,
NPCmaxlifespan: _maxlifespanNPC,
NPClifespan: __lifespanNPC,
NPCmaxhealth: _maxhealthNPC,
NPCmaxenergy: _maxenergyNPC,
NPCcurrenthealth: _currenthealthNPC,
NPCcurrentenergy: _currentenergyNPC,
NPCluck: _luckNPC,
NPCinsight: _insightNPC,
NPCbasestrength: _basestrengthNPC,
NPCbasewillpower: _basewillpowerNPC,
NPCatk: _atkNPC,
NPCdef: _defNPC,
NPCcrit: _critNPC,
NPCcritres: _critresNPC,
NPCagility: _agilityNPC,
NPCmartialArts: _martialArtsNPC,
NPCspiritualRoot: _spiritualRootNPC,
enemyAbility: _enemyability,
NPClocation: _location
}>>
<</silently>>
<</widget>>
<<widget "CreateMentor">>
<<silently>>
<!-- GENERATE CORE ID & GENDER -->
<<set _id = random(0, 10000) + Date.now()>>
<<set _gender = _setupGender ?? ["male","female"].random()>>
<<set _RighteousTendencies = random(100,200)>>
<<set _DemonicTendencies = random(100,200)>>
<<set _enemyability = []>>
<<set _enemyability.push("attack", "attack")>>
<<set _minAge = _setupAge ?? 30>> <!-- Mentors are at least 30 -->
<!-- GENERATE NAME -->
<<if _gender eq "male">>
<<set _name = $male_npc_names.random()>>
<<set _surname = _setupSurname ?? $npc_surnames.random()>>
<<else>>
<<set _name = $female_npc_names.random()>>
<<set _surname = _setupSurname ?? $npc_surnames.random()>>
<</if>>
<<set _enemyregion = "Enemy">>
<!-- GENERATE PORTRAIT & IMAGE -->
<<if _gender eq "male">>
<<set _npcPortrait = "male" + random(1, 32)>>
<<set _enemyimage = ["master1", "master2", "master3"].random()>>
<<else>>
<<set _npcPortrait = "female" + random(1, 26)>>
<<set _enemyimage = ["mentress1", "mentress2", "mentress3"].random()>>
<</if>>
<<set _fullname = _surname + " " + _name>>
<<set _imgID = random(0,10)>>
<!-- PERSONALITY TRAITS (from CreateNPC001) -->
<<set _intTrait = $NPCinternalOptions.random()>>
<<set _extTrait = $NPCexternalOptions.random()>>
<!-- NPC PROPERTIES (from CreateNPC001) -->
<<set _depravity = random(7, 30)>>
<<set _charm = 10>>
<<set _talk = 0>>
<<set _had_sex = 0>>
<<set _npcArousal = 0>>
<<set _npcmentorship = 1>>
<<set _npcRelationship = 0>>
<<set _friendship = 0>>
<!-- SECT AFFILIATION -->
<<set _sectRank to "Elder">>
<<set _sectAffiliation = ["Clear Sky Azure Dragon Pavilion", "Ghost King Netherworld Sect"].random()>>
<<if _sectAffiliation eq "Clear Sky Azure Dragon Pavilion">>
<<set _enemySect to "righteous">>
<<set _location = ["Jade Creek Town", "Northern Phoenix City", "Blood Sand Reach", "Hundred Sorrows Mountain", "Clear Sky Azure Dragon Pavilion"].random()>>
<<else>>
<<set _location = ["Jade Creek Town", "Northern Phoenix City", "Blood Sand Reach", "Hundred Sorrows Mountain", "Ghost King Netherworld Sect"].random()>>
<<set _enemySect to "demonic">>
<</if>>
<!-- REALM & CULTIVATION -->
<<if _targetRealm and _targetStage>>
<<set _realm to _targetRealm>>
<<set _stageType to _targetStage>>
<<set _cultivation = _realm + " " + _stageType>>
<<set _power = $power[_realm][_stageType]>>
<<set _stats = $GenerationNPCRealmStats[_realm][_stageType]>>
<<else>>
<!-- Default: Mentors are high realm -->
<<set _realm = ["Foundation Establishment Realm", "Core Formation Realm", "Nascent Soul Realm"].random()>>
<<set _stageType = ["Early", "Middle", "Late"].random()>>
<<set _cultivation = _realm + " " + _stageType>>
<<set _power = $power[_realm][_stageType]>>
<<set _stats = $GenerationNPCRealmStats[_realm][_stageType]>>
<</if>>
<!-- LIFESPAN & HEALTH GENERATION (from stats table) -->
<<set _maxlifespanNPC = random(_stats.lifespan[0], _stats.lifespan[1])>>
<<set _lifespanNPC = random(_minAge, _maxlifespanNPC)>>
<<set _maxhealthNPC = random(_stats.health[0], _stats.health[1])>>
<<set _currenthealthNPC = _maxhealthNPC>>
<<set _maxenergyNPC = random(_stats.energy[0], _stats.energy[1])>>
<<set _currentenergyNPC = _maxenergyNPC>>
<!-- STAT GENERATION (from stats table) -->
<<set _luckNPC = random(_stats.luck[0], _stats.luck[1])>>
<<set _insightNPC = random(_stats.insight[0], _stats.insight[1])>>
<<set _basestrengthNPC = random(_stats.basestrength[0], _stats.basestrength[1])>>
<<set _basewillpowerNPC = random(_stats.basewillpower[0], _stats.basewillpower[1])>>
<<set _atkNPC = random(_stats.atk[0], _stats.atk[1])>>
<<set _defNPC = random(_stats.def[0], _stats.def[1])>>
<<set _critNPC = random(_stats.crit[0], _stats.crit[1])>>
<<set _critresNPC = random(_stats.critres[0], _stats.critres[1])>>
<<set _agilityNPC = random(_stats.agility[0], _stats.agility[1])>>
<<set _martialArtsNPC = random(_stats.martialArts[0], _stats.martialArts[1])>>
<<set _spiritualRootNPC = random(_stats.spiritualRoot[0], _stats.spiritualRoot[1])>>
<!-- EVASION SCORE -->
<<set _enemyEvadeScore = (_agilityNPC * 2) + (_insightNPC * 1.5) + (_luckNPC * 0.5)>>
<!-- STATUS FLAGS -->
<<set _isMet = false>>
<<set _isFamiliar = false>>
<<set _isRelative = false>>
<<set _isUnknown = true>>
<<set _hasGrudge = false>>
<<set _isDead = false>>
<<set _killedByPlayer = false>>
<<set _killedInRevenge = false>>
<<set _deathCause = null>>
<<set _deathGrudgeType = null>>
<<set _deathGrudgeVictim = null>>
<!-- RELATIONSHIPS STRUCTURE -->
<<set _relations = {
parents: [],
swornParents: [],
masters: [],
spouses: [],
partners: [],
siblings: [],
swornSiblings: [],
children: [],
apprentices: []
}>>
<!-- CREATE MENTOR OBJECT -->
<<set _npc = {
id: _id,
IdImg: _imgID,
name: _name,
surname: _surname,
internalTrait: _intTrait,
externalTrait: _extTrait,
friendship: _friendship,
depravity: _depravity,
charm: _charm,
talk: _talk,
hadSex: _had_sex,
mentorshipType: _npcmentorship,
relationshipType: _npcRelationship,
sectNPC: _sectAffiliation,
realm: _cultivation,
gender: _gender,
npcPortrait: _npcPortrait,
fullname: _fullname,
NPCmaxlifespan: _maxlifespanNPC,
NPClifespan: _lifespanNPC,
NPCmaxhealth: _maxhealthNPC,
NPCmaxenergy: _maxenergyNPC,
NPCcurrenthealth: _currenthealthNPC,
NPCcurrentenergy: _currentenergyNPC,
NPCluck: _luckNPC,
NPCinsight: _insightNPC,
NPCbasestrength: _basestrengthNPC,
NPCbasewillpower: _basewillpowerNPC,
NPCatk: _atkNPC,
NPCdef: _defNPC,
NPCcrit: _critNPC,
NPCcritres: _critresNPC,
NPCagility: _agilityNPC,
NPCmartialArts: _martialArtsNPC,
NPCspiritualRoot: _spiritualRootNPC,
NPClocation: _location,
enemyregion: _enemyregion,
enemyimage: _enemyimage,
enemyEvade: _enemyEvadeScore,
enemyAbility: _enemyability,
RightTendencies: _RighteousTendencies,
DemonTendencies: _DemonicTendencies,
enemySectType: _enemySect,
NPCrank: _sectRank,
power: _power,
npcArousal: _npcArousal,
/* STATUS FLAGS */
isMet: _isMet,
isFamiliar: _isFamiliar,
isRelative: _isRelative,
isUnknown: _isUnknown,
hasGrudge: _hasGrudge,
isDead: _isDead,
killedByPlayer: _killedByPlayer,
killedInRevenge: _killedInRevenge,
deathCause: _deathCause,
deathGrudgeType: _deathGrudgeType,
deathGrudgeVictim: _deathGrudgeVictim,
/* RELATIONSHIP TRACKING */
relations: _relations
}>>
<</silently>>
<</widget>>
<<widget "CreateNPC001">>
<<silently>>
<<set _id = random(0, 10000) + Date.now()>>
<<set _gender = _setupGender ?? ["male","female"].random()>>
<<set _RighteousTendencies = random(100,200)>>
<<set _DemonicTendencies = random(100,200)>>
<<set _enemyability = []>>
<<set _enemyability.push("attack", "attack")>>
<<set _minAge = _setupAge ?? 18>>
<<if _gender eq "male">>
<<set _name = $male_npc_names.random()>>
<<set _surname = _setupSurname ?? $npc_surnames.random()>>
<<else>>
<<set _name = $female_npc_names.random()>>
<<set _surname = _setupSurname ?? $npc_surnames.random()>>
<</if>>
<<set _enemyregion = "Enemy">>
<<set _enemyimage = ["enemy1", "enemy2", "enemy3", "enemy4"].random()>>
<<if _gender eq "male">>
<<set _npcPortrait = "male" + random(1, 32)>>
<<else>>
<<set _npcPortrait = "female" + random(1, 26)>>
<</if>>
<<set _fullname = _surname + " " + _name>>
<<set _imgID = random(0,10)>>
<<set _sectAffiliation = ["Clear Sky Azure Dragon Pavilion", "Ghost King Netherworld Sect", "Unafiliated"].random()>>
<<set _location = ["Jade Creek Town", "Northern Phoenix City", "Blood Sand Reach", "Hundred Sorrows Mountain"].random()>>
<<if _sectAffiliation eq "Clear Sky Azure Dragon Pavilion">><<set _enemySect to "righteous">><<elseif _sectAffiliation eq "Ghost King Netherworld Sect">><<set _enemySect to "demonic">><<else>><<set _enemySect to ["righteous", "demonic"].random() >><</if>>
<<set _npcmentorship = 0>>
<<set _npcRelationship = 0>>
<<if _sectAffiliation eq "Unafiliated">><<set _sectRank to "">><<else>><<set _sectRank to ["Member", "Disciple", "Elder"].random()>><</if>>
<<set _depravity = random(7, 30)>>
<<set _friendship = 0>>
<<set _charm to 10>>
<<set _talk to 0>>
<<set _had_sex to 0>>
<<set _intTrait = $NPCinternalOptions.random()>>
<<set _extTrait = $NPCexternalOptions.random()>>
<<if _targetRealm and _targetStage>>
<<set _realm to _targetRealm>>
<<set _stageType to _targetStage>>
/* Clear them out after using them so they don't infect non-tournament battles */
<<set _cultivation = _realm + " " +_stageType>>
<<set _power = $power[_realm][_stageType]>>
<<set _stats = $GenerationNPCRealmStats[_realm][_stageType]>>
<<else>>
<<set _realm = ["Body Tempering Realm","Meridian Awakening Realm","Qi Condensation Realm"].random()>>
<<set _stageType = ["Early","Middle","Late"].random()>>
<<set _cultivation = _realm + " " +_stageType>>
<<set _power = $power[_realm][_stageType]>>
<<set _stats = $GenerationNPCRealmStats[_realm][_stageType]>>
<</if>>
<<set _maxlifespanNPC = random(_stats.lifespan[0], _stats.lifespan[1])>>
<<set _lifespanNPC = random(_minAge, _maxlifespanNPC)>>
<<set _maxhealthNPC = random(_stats.health[0], _stats.health[1])>>
<<set _currenthealthNPC = _maxhealthNPC>>
<<set _maxenergyNPC = random(_stats.energy[0], _stats.energy[1])>>
<<set _currentenergyNPC = _maxenergyNPC>>
<<set _luckNPC = random(_stats.luck[0], _stats.luck[1])>>
<<set _insightNPC = random(_stats.insight[0], _stats.insight[1])>>
<<set _basestrengthNPC = random(_stats.basestrength[0], _stats.basestrength[1])>>
<<set _basewillpowerNPC = random(_stats.basewillpower[0], _stats.basewillpower[1])>>
<<set _atkNPC = random(_stats.atk[0], _stats.atk[1])>>
<<set _defNPC = random(_stats.def[0], _stats.def[1])>>
<<set _critNPC = random(_stats.crit[0], _stats.crit[1])>>
<<set _critresNPC = random(_stats.critres[0], _stats.critres[1])>>
<<set _agilityNPC = random(_stats.agility[0], _stats.agility[1])>>
<<set _martialArtsNPC = random(_stats.martialArts[0], _stats.martialArts[1])>>
<<set _spiritualRootNPC = random(_stats.spiritualRoot[0], _stats.spiritualRoot[1])>>
<<set _enemyEvadeScore = (_agilityNPC * 2) + (_insightNPC * 1.5) + (_luckNPC * 0.5)>>
<<set _npcArousal = 0>>
<<set _npc = {
npcArousal: _npcArousal,
id: _id,
IdImg: _imgID,
name: _name,
surname: _surname,
internalTrait: _intTrait,
externalTrait: _extTrait,
friendship: _friendship,
depravity: _depravity,
charm: _charm,
talk: _talk,
hadSex: _had_sex,
mentorshipType: _npcmentorship,
relationshipType: _npcRelationship,
sectNPC: _sectAffiliation,
realm: _cultivation,
gender: _gender,
npcPortrait: _npcPortrait,
fullname: _fullname,
NPCmaxlifespan: _maxlifespanNPC,
NPClifespan: _lifespanNPC,
NPCmaxhealth: _maxhealthNPC,
NPCmaxenergy: _maxenergyNPC,
NPCcurrenthealth: _currenthealthNPC,
NPCcurrentenergy: _currentenergyNPC,
NPCluck: _luckNPC,
NPCinsight: _insightNPC,
NPCbasestrength: _basestrengthNPC,
NPCbasewillpower: _basewillpowerNPC,
NPCatk: _atkNPC,
NPCdef: _defNPC,
NPCcrit: _critNPC,
NPCcritres: _critresNPC,
NPCagility: _agilityNPC,
NPCmartialArts: _martialArtsNPC,
NPCspiritualRoot: _spiritualRootNPC,
NPClocation: _location,
enemyregion: _enemyregion,
enemyimage: _enemyimage,
enemyEvade: _enemyEvadeScore,
enemyAbility: _enemyability,
RightTendencies: _RighteousTendencies,
DemonTendencies: _DemonicTendencies,
enemySectType: _enemySect,
NPCrank: _sectRank,
power: _power,
isMet: false,
isFamiliar: false,
isRelative: false,
isUnknown: true,
hasGrudge: false,
deathCause: null, /* "old_age", "murder", "revenge_killed", etc.*/
killedByPlayer: false,
killedInRevenge: false, /* true if killed during a revenge encounter*/
deathGrudgeType: null, /* the type of grudge they were avenging*/
deathGrudgeVictim: null, /* the victim they were avenging*/
isDead: (_setupDead ?? false),
relations: {
parents: [],
swornParents: [],
masters: [],
spouses: [],
partners: [],
siblings: [],
swornSiblings: [],
children: [],
apprentices: []
}
}>>
<</silently>>
<</widget>>
<<widget "GenerateLineageBatch">>
<<silently>>
<<set _existingMain to $args[0] || null>>
<<set $encounterBatch to {}>>
<<set _allNPCs to []>> /* Track all generated NPCs for cross-linking */
/* 1. Generate or use the Focus NPC */
<<if _existingMain>>
<<set _main to _existingMain>>
<<set $encounterMainID to _main.id>>
<<set $encounterBatch[_main.id] to _main>>
<<else>>
<<CreateNPC001>>
<<set _main to _npc>>
<<set _main.isMet to true>>
<<set $encounterMainID to _main.id>>
<<set $encounterBatch[_main.id] to _main>>
<</if>>
/* Ensure main NPC has all relation arrays */
<<if not _main.relations>>
<<set _main.relations to {}>>
<</if>>
<<set _relTypes to ["parents", "swornParents", "masters", "spouses", "partners", "siblings", "swornSiblings", "children", "apprentices", "lovers", "ex_lovers", "betrothed"]>>
<<for _type range _relTypes>>
<<if not _main.relations[_type]>>
<<set _main.relations[_type] to []>>
<</if>>
<</for>>
<<set _allNPCs.push(_main)>>
/* 2. PARENTS (Father & Mother) */
<<set _parentPool to [
{ type: "father", chance: 60, gender: "male", sameSurname: true, ageMod: [20, 50] },
{ type: "mother", chance: 50, gender: "female", sameSurname: false, ageMod: [18, 45] }
]>>
<<for _rel range _parentPool>>
<<if random(1, 100) lte _rel.chance>>
<<set _setupSurname to (_rel.sameSurname ? _main.surname : null)>>
<<set _setupAge to _main.NPClifespan + random(_rel.ageMod[0], _rel.ageMod[1])>>
<<set _setupGender to _rel.gender>>
<<set _setupDead to (random(1, 100) lt 20)>>
<<CreateNPC001>>
<<set _rNPC to _npc>>
<<set _rNPC.isMet to false>>
/* Ensure new NPC has relation arrays */
<<if not _rNPC.relations>>
<<set _rNPC.relations to {}>>
<</if>>
<<for _type range _relTypes>>
<<if not _rNPC.relations[_type]>>
<<set _rNPC.relations[_type] to []>>
<</if>>
<</for>>
/* Create two-way parent-child links */
<<run _main.relations.parents.push(_rNPC.id)>>
<<run _rNPC.relations.children.push(_main.id)>>
<<set $encounterBatch[_rNPC.id] = _rNPC>>
<<set _allNPCs.push(_rNPC)>>
<</if>>
<</for>>
/* 3. LOVERS AND ROMANTIC CONNECTIONS */
<<set _romancePool to [
{ type: "lover", chance: 30, category: "lovers", ageMod: [-5, 5] },
{ type: "ex_lover", chance: 15, category: "ex_lovers", ageMod: [-10, 10] },
{ type: "betrothed", chance: 10, category: "betrothed", ageMod: [-5, 5] }
]>>
<<for _rel range _romancePool>>
<<if random(1, 100) lte _rel.chance>>
<<set _setupGender to (_main.gender == "male" ? "female" : "male")>>
<<set _setupSurname to null>> /* Lovers keep their own surnames */
<<set _setupAge to _main.NPClifespan + random(_rel.ageMod[0], _rel.ageMod[1])>>
<<set _setupDead to (random(1, 100) lt 15)>>
<<CreateNPC001>>
<<set _rNPC to _npc>>
<<set _rNPC.isMet to false>>
/* Ensure new NPC has relation arrays */
<<if not _rNPC.relations>>
<<set _rNPC.relations to {}>>
<</if>>
<<for _type range _relTypes>>
<<if not _rNPC.relations[_type]>>
<<set _rNPC.relations[_type] to []>>
<</if>>
<</for>>
/* Create two-way romantic links */
<<if _rel.type eq "lover">>
<<run _main.relations.lovers.push(_rNPC.id)>>
<<run _rNPC.relations.lovers.push(_main.id)>>
<<elseif _rel.type eq "ex_lover">>
<<run _main.relations.ex_lovers.push(_rNPC.id)>>
<<run _rNPC.relations.ex_lovers.push(_main.id)>>
<<elseif _rel.type eq "betrothed">>
<<run _main.relations.betrothed.push(_rNPC.id)>>
<<run _rNPC.relations.betrothed.push(_main.id)>>
<</if>>
<<set $encounterBatch[_rNPC.id] = _rNPC>>
<<set _allNPCs.push(_rNPC)>>
<</if>>
<</for>>
/* 4. SIBLINGS */
<<set _siblingCount to random(0, 3)>>
<<set _siblings to []>>
<<for _i = 0; _i lt _siblingCount; _i++>>
<<if random(1, 100) lt 40>>
<<set _setupSurname to _main.surname>>
<<set _setupAge to _main.NPClifespan + random(-10, 10)>>
<<set _setupDead to (random(1, 100) lt 15)>>
<<set _setupGender to ["male", "female"].random()>>
<<CreateNPC001>>
<<set _rNPC to _npc>>
<<set _rNPC.isMet to false>>
/* Ensure new NPC has relation arrays */
<<if not _rNPC.relations>>
<<set _rNPC.relations to {}>>
<</if>>
<<for _type range _relTypes>>
<<if not _rNPC.relations[_type]>>
<<set _rNPC.relations[_type] to []>>
<</if>>
<</for>>
<<set _siblings.push(_rNPC)>>
<<set $encounterBatch[_rNPC.id] = _rNPC>>
<<set _allNPCs.push(_rNPC)>>
<</if>>
<</for>>
/* Link siblings to each other and to parents */
<<for _sibling range _siblings>>
/* Link to main */
<<if not _main.relations.siblings.includes(_sibling.id)>>
<<run _main.relations.siblings.push(_sibling.id)>>
<</if>>
<<if not _sibling.relations.siblings.includes(_main.id)>>
<<run _sibling.relations.siblings.push(_main.id)>>
<</if>>
/* Link to parents if they exist */
<<for _parentId range _main.relations.parents>>
<<if not _sibling.relations.parents.includes(_parentId)>>
<<run _sibling.relations.parents.push(_parentId)>>
<</if>>
/* Add sibling to parent's children */
<<set _parent = $encounterBatch[_parentId]>>
<<if _parent and not _parent.relations.children.includes(_sibling.id)>>
<<run _parent.relations.children.push(_sibling.id)>>
<</if>>
<</for>>
<</for>>
/* 5. MASTERS */
<<set _masterCount to random(1, 2)>>
<<for _i = 0; _i lt _masterCount; _i++>>
<<if random(1, 100) lt 30>>
<<set _setupAge to _main.NPClifespan + random(30, 100)>>
<<set _setupDead to (random(1, 100) lt 25)>>
<<set _setupGender to ["male", "female"].random()>>
<<set _setupSurname to null>>
<<CreateNPC001>>
<<set _rNPC to _npc>>
<<set _rNPC.isMet to false>>
/* Ensure new NPC has relation arrays */
<<if not _rNPC.relations>>
<<set _rNPC.relations to {}>>
<</if>>
<<for _type range _relTypes>>
<<if not _rNPC.relations[_type]>>
<<set _rNPC.relations[_type] to []>>
<</if>>
<</for>>
<<run _main.relations.masters.push(_rNPC.id)>>
<<run _rNPC.relations.apprentices.push(_main.id)>>
<<set $encounterBatch[_rNPC.id] = _rNPC>>
<<set _allNPCs.push(_rNPC)>>
<</if>>
<</for>>
/* 6. APPRENTICES */
<<if _main.NPClifespan gt 30>>
<<set _apprCount to random(0, 2)>>
<<for _i = 0; _i lt _apprCount; _i++>>
<<if random(1, 100) lt 25>>
<<set _setupAge to random(18, _main.NPClifespan - 10)>>
<<set _setupDead to (random(1, 100) lt 15)>>
<<set _setupGender to ["male", "female"].random()>>
<<set _setupSurname to null>>
<<CreateNPC001>>
<<set _rNPC to _npc>>
<<set _rNPC.isMet to false>>
/* Ensure new NPC has relation arrays */
<<if not _rNPC.relations>>
<<set _rNPC.relations to {}>>
<</if>>
<<for _type range _relTypes>>
<<if not _rNPC.relations[_type]>>
<<set _rNPC.relations[_type] to []>>
<</if>>
<</for>>
<<run _main.relations.apprentices.push(_rNPC.id)>>
<<run _rNPC.relations.masters.push(_main.id)>>
<<set $encounterBatch[_rNPC.id] = _rNPC>>
<<set _allNPCs.push(_rNPC)>>
<</if>>
<</for>>
<</if>>
/* 7. FINAL PASS: Ensure all family connections are complete */
<<for _npc1 range _allNPCs>>
<<for _npc2 range _allNPCs>>
<<if _npc1.id != _npc2.id>>
/* If they share parents, ensure sibling link exists */
<<set _shareParents to false>>
<<for _parentId range _npc1.relations.parents>>
<<if _npc2.relations.parents.includes(_parentId)>>
<<set _shareParents to true>>
<</if>>
<</for>>
<<if _shareParents>>
<<if not _npc1.relations.siblings.includes(_npc2.id)>>
<<run _npc1.relations.siblings.push(_npc2.id)>>
<</if>>
<<if not _npc2.relations.siblings.includes(_npc1.id)>>
<<run _npc2.relations.siblings.push(_npc1.id)>>
<</if>>
<</if>>
/* Ensure child-parent links are bidirectional */
<<if _npc1.relations.parents.includes(_npc2.id) and not _npc2.relations.children.includes(_npc1.id)>>
<<run _npc2.relations.children.push(_npc1.id)>>
<</if>>
<<if _npc2.relations.parents.includes(_npc1.id) and not _npc1.relations.children.includes(_npc2.id)>>
<<run _npc1.relations.children.push(_npc2.id)>>
<</if>>
<</if>>
<</for>>
<</for>>
<</silently>>
<</widget>><<set $male_npc_names = [
"Yun","Jie","Tian","Rui","Sheng","Zhen","Hao","Lei","Qing","Long","Xuan","Bo","Chen","Yue","Jin","Wei","Ren","Fang","Yao","Heng","Zhi","Xing","Han","Fei","Chao"
]>>
<<set $female_npc_names = [
"Mei","Lian","Hua","Xue","Ling","Yue","Lan","Qin","Rin","Yin","Shui","Fen","Zhi","Ai","Na","Yu","Ning","Ting","Xia","Bo","Qiao","Min","Ruo","Li","Jing"
]>>
<<set $npc_surnames = [
"Li","Zhao","Mo","Feng","Shen","Wei","Jiang","Han","Leng","Wu","Zhou","Yan","Bai","Chen","Duan","Qin","Xie","Lin","Zhang","Gu"
]>>
<<set $known_npc_list = []>>
<<set $npc_list = []>>
<<set $npc_fem_list = []>>
<<set $active_npc = []>>
<<set $npc_sects =[
"Heavenly Sword Pavilion", "Dragonblood Imperial Clan", "Violet Flame Sect", "Sun-Crushing Hall", "Everlasting Sky Clan", "Black Jade Phoenix Palace", "Golden Tyrant Sect", "Thousand Thunder Pavilion"
]>>
<<set $enemyBattleQuotes = [
"Your moves are crude. Were you trained by farmers?",
"Hah! Is that all your sect has taught you?",
"You dare face me with such pitiful strength?",
"The heavens themselves tremble at my cultivation!",
"You’ll need more than flashy footwork to defeat me.",
"Even my juniors hit harder than that.",
"Your fate was sealed the moment you stepped into this arena.",
"My qi flows like a raging river. You cannot stop it.",
"You might land a strike, but you’ll never break my will.",
"Come! Let this be a lesson written in bruises.",
"You fight with courage... but lack wisdom.",
"Still standing? Impressive... but futile.",
"This duel is over — you just don’t know it yet.",
"Your spiritual roots are weak. I sense no destiny in you.",
"Let’s see how long that arrogance lasts under pressure.",
"You hold back. Why? Are you afraid of your own strength?",
"I’ve bested beasts with more fight than you.",
"Is this what the righteous path teaches now? Pathetic.",
"You're not bad... but I won’t lose to someone like you.",
"A spark of talent — wasted on someone without control."
]>>
<<set $neutralTalkNPC to [
"You look like a new face around here.",
"Not many travelers pass through this area.",
"What brings you to this place?",
"Be careful. Not all cultivators are as kind as they appear.",
"The spiritual energy feels dense today, doesn't it?"
]>>
<<set $friendlyTalkNPC to [
"It’s always good to see a friendly face.",
"Training hard again? You never take a break.",
"I found a quiet spot by the waterfall—you’d love it.",
"Let me know if you ever need help with your cultivation.",
"The sect's been talking about your progress. You're not bad."
]>>
<<set $loverTalkNPC to [
"I dreamed of you last night…",
"Come closer. I want to feel your presence.",
"You always make my heart feel lighter.",
"After everything, I’m glad we met.",
"When this world turns to chaos, remember you have me."
]>>
<<set $highDepravityTalkNPC to [
"Power is the only language worth speaking.",
"Desire isn't a weakness—it's fuel.",
"Have you ever killed someone and felt… exhilarated?",
"Kindness? That's a lie we tell ourselves.",
"I could show you things you'd never forget… if you're brave enough."
]>>
<<set $MentorTalkNPC to [
"Your stance is improving. Slightly.",
"Discipline, focus, and patience—that’s the path.",
"Did you review the techniques I assigned?",
"Even a spark can become a flame. Don’t waste your potential.",
"I was once like you… hungry for power, blind to the cost."
]>>
<<set $ApprenticeTalkNPC to [
"Master, do you think I’m ready for the next realm?",
"I tried the technique you showed me, but something feels off.",
"Thank you for taking me in. I won’t disappoint you.",
"Sometimes I wonder why you chose me.",
"Your teachings… they saved me more than once."
]>>
<<set $enemyTalkNPC to [
"Still alive? Disappointing.",
"One day, I’ll surpass you. Count on it.",
"Don’t think I’ve forgotten what you did.",
"You may have power, but you lack honor.",
"Every time we speak, I lose more respect for you."
]>>
<<set $highTalk to [
"You’ve changed since we first met.",
"Talking to you always makes things clearer.",
"Strange… I never thought I’d trust someone like you.",
"So much has happened, hasn’t it?",
"Even in silence, your presence comforts me."
]>>
<<set $activeGrudges to []>> // Array to store active grudges
/* Grudge structure:
// {
// id: unique_id,
// avengerId: npc_id,
// victimId: npc_id (the one who was wronged or their relative),
// type: "rape", "seduction", "murder", "theft", "humiliation", "betrayal",
// severity: 1-10,
// targetType: "player", "npc",
// triggered: false,
// location: "any", "city", "wilderness", "sect",
// relationshipToVictim: "lover", "parent", "sibling", "master", "friend"
// } */
<<set $cultivationRealms = ["Body Tempering Realm", "Meridian Awakening Realm", "Qi Condensation Realm", "Foundation Establishment Realm", "Core Formation Realm", "Nascent Soul Realm"]>>
<<set $cultivationStages = ["Early", "Middle", "Late"]>>
<<set $GenerationNPCRealmStats = {
"Body Tempering Realm": {
"Early": {
"lifespan": [70, 80],
"health": [250, 320],
"energy": [180, 220],
"luck": [4, 6],
"insight": [4, 6],
"basestrength": [4, 6],
"basewillpower": [4, 6],
"atk": [35, 45],
"def": [4, 6],
"crit": [2, 4],
"critres": [1, 2],
"agility": [6, 8],
"martialArts": [8, 12],
"spiritualRoot": [9, 11]
},
"Middle": {
"lifespan": [85, 115],
"health": [350, 450],
"energy": [250, 320],
"luck": [6, 10],
"insight": [6, 10],
"basestrength": [7, 10],
"basewillpower": [6, 9],
"atk": [45, 85],
"def": [6, 10],
"crit": [4, 7],
"critres": [3, 5],
"agility": [8, 12],
"martialArts": [12, 18],
"spiritualRoot": [11, 14]
},
"Late": {
"lifespan": [115, 130],
"health": [500, 700],
"energy": [350, 500],
"luck": [8, 14],
"insight": [10, 16],
"basestrength": [11, 15],
"basewillpower": [10, 14],
"atk": [85, 120],
"def": [12, 18],
"crit": [6, 10],
"critres": [6, 10],
"agility": [12, 18],
"martialArts": [16, 25],
"spiritualRoot": [15, 20]
}
},
"Meridian Awakening Realm": {
"Early": {
"lifespan": [135, 140],
"health": [750, 900],
"energy": [600, 720],
"luck": [10, 14],
"insight": [12, 16],
"basestrength": [16, 20],
"basewillpower": [14, 18],
"atk": [120, 170],
"def": [20, 30],
"crit": [8, 12],
"critres": [8, 12],
"agility": [16, 22],
"martialArts": [24, 32],
"spiritualRoot": [22, 30]
},
"Middle": {
"lifespan": [145, 150],
"health": [1000, 1200],
"energy": [800, 1000],
"luck": [14, 20],
"insight": [18, 24],
"basestrength": [20, 26],
"basewillpower": [18, 24],
"atk": [170, 220],
"def": [28, 40],
"crit": [10, 16],
"critres": [10, 16],
"agility": [22, 30],
"martialArts": [30, 40],
"spiritualRoot": [28, 36]
},
"Late": {
"lifespan": [155, 160],
"health": [1400, 1800],
"energy": [1200, 1600],
"luck": [20, 28],
"insight": [26, 34],
"basestrength": [28, 36],
"basewillpower": [26, 32],
"atk": [220, 270],
"def": [40, 55],
"crit": [14, 20],
"critres": [14, 20],
"agility": [30, 40],
"martialArts": [38, 50],
"spiritualRoot": [35, 45]
}
},
"Qi Condensation Realm": {
"Early": {
"lifespan": [165, 170],
"health": [1900, 2300],
"energy": [1700, 2100],
"luck": [15, 20],
"insight": [20, 26],
"basestrength": [30, 38],
"basewillpower": [28, 35],
"atk": [300, 380],
"def": [45, 65],
"crit": [12, 18],
"critres": [12, 18],
"agility": [35, 45],
"martialArts": [45, 60],
"spiritualRoot": [40, 55]
},
"Middle": {
"lifespan": [175, 185],
"health": [2400, 2900],
"energy": [2200, 2700],
"luck": [20, 28],
"insight": [26, 34],
"basestrength": [38, 48],
"basewillpower": [35, 44],
"atk": [380, 480],
"def": [60, 85],
"crit": [16, 24],
"critres": [16, 24],
"agility": [45, 58],
"martialArts": [58, 75],
"spiritualRoot": [52, 70]
},
"Late": {
"lifespan": [190, 210],
"health": [3000, 3800],
"energy": [2800, 3500],
"luck": [26, 36],
"insight": [34, 44],
"basestrength": [48, 60],
"basewillpower": [44, 55],
"atk": [480, 580],
"def": [80, 110],
"crit": [22, 30],
"critres": [22, 30],
"agility": [55, 70],
"martialArts": [72, 90],
"spiritualRoot": [65, 85]
}
},
"Foundation Establishment Realm": {
"Early": {
"lifespan": [220, 250],
"health": [4200, 5200],
"energy": [3800, 4600],
"luck": [28, 38],
"insight": [38, 50],
"basestrength": [55, 70],
"basewillpower": [50, 65],
"atk": [620, 750],
"def": [100, 135],
"crit": [25, 35],
"critres": [25, 35],
"agility": [65, 82],
"martialArts": [85, 110],
"spiritualRoot": [80, 105]
},
"Middle": {
"lifespan": [255, 290],
"health": [5400, 6800],
"energy": [4800, 5900],
"luck": [35, 48],
"insight": [48, 62],
"basestrength": [68, 85],
"basewillpower": [62, 78],
"atk": [760, 920],
"def": [130, 170],
"crit": [32, 45],
"critres": [32, 45],
"agility": [80, 100],
"martialArts": [105, 135],
"spiritualRoot": [100, 130]
},
"Late": {
"lifespan": [300, 350],
"health": [7000, 8800],
"energy": [6100, 7600],
"luck": [45, 60],
"insight": [60, 78],
"basestrength": [85, 105],
"basewillpower": [78, 95],
"atk": [930, 1120],
"def": [165, 215],
"crit": [40, 55],
"critres": [40, 55],
"agility": [98, 122],
"martialArts": [130, 165],
"spiritualRoot": [125, 160]
}
},
"Core Formation Realm": {
"Early": {
"lifespan": [380, 450],
"health": [9500, 12000],
"energy": [8500, 10500],
"luck": [50, 68],
"insight": [70, 90],
"basestrength": [110, 140],
"basewillpower": [100, 125],
"atk": [1250, 1550],
"def": [220, 290],
"crit": [48, 65],
"critres": [48, 65],
"agility": [120, 150],
"martialArts": [170, 215],
"spiritualRoot": [155, 200]
},
"Middle": {
"lifespan": [460, 550],
"health": [12500, 15800],
"energy": [11000, 13800],
"luck": [65, 85],
"insight": [88, 112],
"basestrength": [135, 170],
"basewillpower": [125, 155],
"atk": [1580, 1950],
"def": [280, 370],
"crit": [60, 80],
"critres": [60, 80],
"agility": [150, 185],
"martialArts": [210, 265],
"spiritualRoot": [195, 245]
},
"Late": {
"lifespan": [560, 700],
"health": [16500, 21000],
"energy": [14500, 18000],
"luck": [80, 105],
"insight": [110, 140],
"basestrength": [165, 210],
"basewillpower": [155, 190],
"atk": [1980, 2450],
"def": [360, 470],
"crit": [75, 100],
"critres": [75, 100],
"agility": [185, 230],
"martialArts": [260, 330],
"spiritualRoot": [240, 300]
}
},
"Nascent Soul Realm": {
"Early": {
"lifespan": [800, 1200],
"health": [24000, 31000],
"energy": [21000, 27000],
"luck": [95, 125],
"insight": [130, 170],
"basestrength": [220, 280],
"basewillpower": [200, 255],
"atk": [2700, 3400],
"def": [480, 620],
"crit": [90, 120],
"critres": [90, 120],
"agility": [240, 300],
"martialArts": [340, 430],
"spiritualRoot": [290, 370]
},
"Middle": {
"lifespan": [1300, 1800],
"health": [32000, 42000],
"energy": [28000, 36000],
"luck": [120, 160],
"insight": [165, 215],
"basestrength": [275, 350],
"basewillpower": [255, 320],
"atk": [3500, 4400],
"def": [610, 790],
"crit": [115, 150],
"critres": [115, 150],
"agility": [300, 375],
"martialArts": [430, 540],
"spiritualRoot": [360, 460]
},
"Late": {
"lifespan": [2000, 3000],
"health": [45000, 60000],
"energy": [39000, 52000],
"luck": [155, 210],
"insight": [210, 270],
"basestrength": [350, 440],
"basewillpower": [320, 400],
"atk": [4600, 5800],
"def": [780, 1000],
"crit": [145, 190],
"critres": [145, 190],
"agility": [380, 480],
"martialArts": [550, 700],
"spiritualRoot": [450, 580]
}
}
}>><div style="max-width:900px; margin:30px auto; line-height:1.9; font-size:1.05em; color:#e8e8e8;">
<h3 style="text-align:center; color:#ffd700; margin-bottom:30px; text-shadow:0 0 15px rgba(255,215,0,0.8); font-size:1.6em; letter-spacing:2px;">
◆ Interacting with <<print $currentNPC.fullname>> ◆
</h3>
<!-- Helper to persist changes -->
<<set _updateNPC = function() {
let idx = $known_npc_list.findIndex(n => n.id === $currentNPC.id);
if (idx !== -1) $known_npc_list[idx] = $currentNPC;
}>>
<!-- Helper for atmospheric transitions -->
<<set _getMood = function(npc) {
if (npc.friendship >= 80) return "warm";
if (npc.friendship >= 50) return "neutral";
if (npc.friendship >= 30) return "guarded";
return "distant";
}>>
<!-- Helper for reaction descriptions -->
<<set _getReaction = function(npc, type) {
let mood = _getMood(npc);
if (type === "greet") {
if (mood === "warm") return either("brightens visibly", "smiles softly", "offers you their full attention", "reaches toward you warmly");
if (mood === "neutral") return either("nods in acknowledgment", "greets you evenly", "regards you with interest", "inclines their head");
if (mood === "guarded") return either("eyes you cautiously", "offers a measured smile", "studies you carefully", "nods slightly");
return either("glances up coolly", "regards you distantly", "gives minimal acknowledgment", "maintains a careful distance");
}
return "shows interest";
}>>
<!-- ==================== TALK ==================== -->
<<if $relationAction is "talk">>
<p style="color:#d4af37; margin-bottom:15px;">
<<print $currentNPC.fullname>> <<print _getReaction($currentNPC, "greet")>>.
<<if $currentNPC.friendship gte 60>>
The aura around them seems to relax in your presence.
<<elseif $currentNPC.friendship lte 20>>
A faint barrier of qi hovers between you both.
<<else>>
Their demeanor remains composed yet observant.
<</if>>
</p>
<<if $currentNPC.gender is "female">>
<p><span class="female" style="color:#ff69b4;">"<<print either(
"You return to me... the heavens must smile upon my fortune.",
"Your visits bring light to even the darkest meditation.",
"Speak your heart. I find I wish to know your thoughts.",
"How... interesting that you seek me out again.",
"The sect feels less empty when you are near."
)>>"</span></p>
<<else>>
<p><span class="male" style="color:#87ceeb;">"<<print either(
"You show wisdom in seeking my counsel.",
"Another meeting between us... fate is clever.",
"Speak freely. Your words have begun to hold weight with me.",
"I sense you wish to share something. Proceed.",
"Your presence carries purpose. What drives you this time?"
)>>"</span></p>
<</if>>
<div id="talk-choices" style="margin-top:20px;">
<<link "💫 Discuss cultivation">>
<<replace "#talk-choices">>
<p style="margin:15px 0;">You settle into a comfortable posture, opening your inner sight to share insights about qi resonance, meridian pathways, and the subtle dance between intent and execution.</p>
<<if $currentNPC.friendship gte 70>>
<p style="margin:15px 0; font-style:italic; color:#c9a961;"><<print $currentNPC.fullname>> leans forward with genuine interest, their eyes reflecting the glow of inner perception. They listen not as a superior, but as one who recognizes a kindred seeker.</p>
<<if $currentNPC.gender is "female">>
<p><span class="female" style="color:#ff69b4;">"<<print either(
"You possess the rare gift of bridging knowledge and understanding. Your dantian resonates with potential—nurture it as one would a sacred flame.",
"The path you describe... I walked it once. Reverse circulation during the third watch brought my clarity. Trust in silence more than struggle.",
"The Dao does not rush. Those who demand swift ascension often stumble. You, however—you listen to the subtle currents. Continue as you are.",
"Your foundation is like carved jade—solid and true. What you lack is not strength but faith in what you have already become."
)>>"</span></p>
<<else>>
<p><span class="male" style="color:#87ceeb;">"<<print either(
"Few possess such balanced perspective. Your mind moves like water around obstacles rather than crashing against them like stone.",
"I sense you in my own breakthrough moments—that hunger tempered by patience. Rare. Precious. Guard it well.",
"The Dao opens itself not to the greedy but to those who listen. You listen well.",
"Your insight borders on enlightenment. Push past this threshold with gentle persistence, not force."
)>>"</span></p>
<</if>>
<<set $exp += 150>>
<<set $currentNPC.friendship = Math.min(100, $currentNPC.friendship + random(8,15))>>
<<run _updateNPC()>>
<p style="color:#90EE90; margin-top:15px;"><em>✦ +150 EXP gained. Profound connection deepened. <<print $currentNPC.fullname>> views you with new respect.</em></p>
<<elseif $currentNPC.friendship gte 40>>
<p style="margin:15px 0; font-style:italic; color:#c9a961;">They listen with measured attention, occasionally nodding as recognition flickers across their features. A teacher's patience mingles with a seeker's curiosity.</p>
<<if $currentNPC.gender is "female">>
<p><span class="female" style="color:#ff69b4;">"Your approach shows promise. These techniques you mention—I recognize their lineage. You are on a sound path, though still early in your journey. Continue with diligence."</span></p>
<<else>>
<p><span class="male" style="color:#87ceeb;">"The fundamentals you describe are solid. Your understanding is emerging, though much depth awaits beyond the horizon. Persist without haste."</span></p>
<</if>>
<<set $exp += 90>>
<<set $currentNPC.friendship = Math.min(100, $currentNPC.friendship + random(5,10))>>
<<run _updateNPC()>>
<p style="color:#90EE90; margin-top:15px;"><em>✦ +90 EXP gained. Friendship moderately increased.</em></p>
<<else>>
<p style="margin:15px 0; font-style:italic; color:#c9a961;">They listen with polite distance, their attention like moonlight—present but cool, neither warm nor dismissive.</p>
<<if $currentNPC.gender is "female">>
<p><span class="female" style="color:#ff69b4;">"Such matters are deeply personal. The Dao speaks differently to each seeker. You must find your own voice in its silence."</span></p>
<<else>>
<p><span class="male" style="color:#87ceeb;">"These are your challenges to navigate. I do not doubt you will find your own answers."</span></p>
<</if>>
<<set $exp += 40>>
<<set $currentNPC.friendship = Math.min(100, $currentNPC.friendship + random(2,5))>>
<<run _updateNPC()>>
<p style="color:#90EE90; margin-top:15px;"><em>✦ +40 EXP gained.</em></p>
<</if>>
<</replace>>
<</link>>
<br>
<<link "🌙 Ask about their past">>
<<replace "#talk-choices">>
<p style="margin:15px 0;">You settle back, voice gentle and patient. "I sense depth in you—stories of trials and triumphs. Would you share some of your journey with me?"</p>
<<if $currentNPC.internalTrait is "Wicked" or $currentNPC.internalTrait is "Selfish" or $currentNPC.internalTrait is "Evil">>
<p style="margin:15px 0; font-style:italic; color:#8b0000;">A dark smile curves their lips, and the temperature around you seems to drop. Their eyes gleam with dangerous nostalgia.</p>
<p><span style="color:#ff1744;">"Ah, you wish to know the shape of my ascent? It is written in the bones of those who stood in my way. Power is not gifted—it is taken. I learned this lesson early and have never forgotten it. The weak are stones for the strong to stand upon."</span></p>
<<if $corruption lt 80>>
<p style="margin:15px 0; color:#d4af37;"><em>Their words carry the weight of genuine conviction, chilling and absolute.</em></p>
<</if>>
<<elseif $currentNPC.internalTrait is "Selfless" or $currentNPC.internalTrait is "Upstanding" or $currentNPC.internalTrait is "Kind">>
<p style="margin:15px 0; font-style:italic; color:#90EE90;">Warmth blooms in their expression. Their gaze turns inward, reflecting on memories both painful and precious.</p>
<p><span style="color:#87ceeb;">"I have walked a path of helping others because the suffering of innocents once nearly consumed me. I learned that true strength lies not in domination but in lifting others from darkness. The Dao rewards compassion with unexpected blessings."</span></p>
<<else>>
<p style="margin:15px 0; font-style:italic; color:#c9a961;">Their features grow thoughtful, caught between shadows and light.</p>
<p><span style="color:#d4af37;">"Life has taught me that neither absolute virtue nor absolute ambition brings peace. I walk between extremes, learning from both triumph and failure."</span></p>
<</if>>
<<if $currentNPC.externalTrait is "Vengeful">>
<p style="margin:15px 0; color:#8b0000;">Their hands clench slightly, and for a moment, killing intent flickers through the air like a sharp blade.</p>
<p><span style="color:#ff1744;">"Some debts cannot be settled by coin or apology. Some require the price of blood. I have enemies, and I will not rest until they understand the weight of their betrayals."</span></p>
<<elseif $currentNPC.externalTrait is "Romantic">>
<p style="margin:15px 0; color:#ff69b4;">Their expression softens into something achingly vulnerable. A wistful sadness crosses their features.</p>
<p><span style="color:#ff69b4;">"I loved once, truly and completely. That love shaped my ascension as much as any technique. Now... I carry that memory like a sword—beautiful and dangerous, never far from my heart."</span></p>
<<elseif $currentNPC.externalTrait is "Power-hungry">>
<p style="margin:15px 0; color:#ffd700;">Their eyes burn with barely contained ambition. The air thrums with their hunger for greater heights.</p>
<p><span style="color:#ffd700;">"Every realm I conquer is but a step toward the next. Power is truth—the only constant in a shifting world. I will ascend until the heavens themselves bow to my will."</span></p>
<<elseif $currentNPC.externalTrait is "Family-oriented">>
<p style="margin:15px 0; color:#ffc0cb;">Their features warm with genuine affection, and protective qi swirls around them unconsciously.</p>
<p><span style="color:#ff69b4;">"My clan is my anchor. Every strength I gain, every technique I master—these are for their protection and honor. Blood bonds transcend even the boundaries of death."</span></p>
<</if>>
<<set $currentNPC.talk += 1>>
<<set $currentNPC.friendship = Math.min(100, $currentNPC.friendship + random(6,12))>>
<<run _updateNPC()>>
<p style="color:#90EE90; margin-top:15px;"><em>✦ Friendship increased. You glimpsed the soul beneath the cultivation.</em></p>
<</replace>>
<</link>>
<br>
<<link "💋 Flirt / Tease">>
<<replace "#talk-choices">>
<<if $currentNPC.depravity gte 40 or $currentNPC.friendship gte 60>>
<p style="margin:15px 0; font-style:italic; color:#d4af37;">You lean closer, voice dropping to something more intimate. Your eyes meet theirs with unmistakable intent, and the air between you crackles with new energy.</p>
<p style="margin:15px 0;"><<print $currentNPC.fullname>> <<print either(
"brushes a strand of hair from their face, eyes darkening",
"meets your gaze steadily, a knowing smile playing at their lips",
"blushes slightly, caught between amusement and something deeper",
"leans in closer, their breath warm"
)>>.</p>
<<if $currentNPC.depravity gte 75>>
<<if $currentNPC.gender is "female">>
<p><span class="female" style="color:#ff69b4;">"<<print either(
"You play with fire, knowing full well it will burn you... and I find I no longer wish to extinguish these flames.",
"Such boldness. Continue, and you may find yourself unable to leave this chamber.",
"Is that an invitation? Because I am very much inclined to accept it.",
"You are either very brave or very foolish. I cannot decide which excites me more."
)>>"</span></p>
<<else>>
<p><span class="male" style="color:#87ceeb;">"<<print either(
"Your boldness intoxicates me. Test my restraint further and face the consequences.",
"Such words from you... they ignite something within I thought long dormant.",
"You seem intent on unraveling my composure. Dangerous game.",
"I like your courage. Let us see how far you are willing to take this."
)>>"</span></p>
<</if>>
<<set $currentNPC.depravity = Math.min(100, $currentNPC.depravity + random(4,10))>>
<<elseif $currentNPC.depravity gte 50>>
<<if $currentNPC.gender is "female">>
<p><span class="female" style="color:#ff69b4;">"<<print either(
"You are... surprisingly forward. I do not mind.",
"Such intensity from you. My heart finds itself racing.",
"Perhaps there is more to you than meets the eye.",
"You are dangerous in ways that have nothing to do with cultivation."
)>>"</span></p>
<<else>>
<p><span class="male" style="color:#87ceeb;">"<<print either(
"Your boldness is intriguing. Proceed carefully.",
"This side of you... I find it compelling.",
"You surprise me. Continue.",
"Such boldness deserves acknowledgment."
)>>"</span></p>
<</if>>
<<set $currentNPC.depravity = Math.min(100, $currentNPC.depravity + random(3,7))>>
<<else>>
<p style="margin:15px 0; font-style:italic; color:#c9a961;">They pull back slightly, clearing their throat. Their expression remains kind but noticeably more reserved.</p>
<p><span style="color:#d4af37;">"You honor me with your attention, but perhaps we should maintain... propriety for now."</span></p>
<</if>>
<<else>>
<p style="margin:15px 0; font-style:italic; color:#c9a961;">Your attempt at seduction meets polite resistance. They respond with warmth, but it is the warmth of distant stars—beautiful but untouchable.</p>
<p><span style="color:#d4af37;">"Your company is treasured, but such intimacy requires deeper understanding between us."</span></p>
<</if>>
<<set $currentNPC.friendship = Math.min(100, $currentNPC.friendship + random(3,8))>>
<<run _updateNPC()>>
<p style="color:#90EE90; margin-top:15px;"><em>✦ Friendship slightly increased.</em></p>
<</replace>>
<</link>>
</div>
<br><br>
<<link "← Return">><<goto "RelationsDetailed">><</link>>
<!-- ==================== BOND ==================== -->
<<elseif $relationAction is "bond">>
<p style="margin:15px 0; color:#d4af37;">You suggest spending time together—not in training or duty, but in genuine presence. Something precious and rare in the harsh world of cultivation.</p>
<<if $currentNPC.friendship gte 80>>
<p style="margin:15px 0; font-style:italic; color:#c9a961;"><<print $currentNPC.fullname>>'s face brightens noticeably. They rise and take your hand without hesitation, qi flowing warm and welcoming.</p>
<p style="margin:15px 0; color:#90EE90;">Together, you share a quiet meal beneath ancient pines, where the wind carries the scent of distant mountains. As twilight paints the sky in shades of crimson and gold, you sit side by side, watching the stars ignite one by one. Your cultivations synchronize naturally—two flames burning in harmony rather than isolation.</p>
<p style="margin:15px 0; font-style:italic; color:#d4af37;">In this moment, the barriers between you dissolve. What emerges is something profound—a connection that transcends mere friendship. Trust, understanding, and genuine affection interweave like threads of silk.</p>
<<set $currentNPC.friendship = Math.min(100, $currentNPC.friendship + random(18,28))>>
<<set $exp += 120>>
<<run _updateNPC()>>
<p style="color:#90EE90; margin-top:15px;"><em>✦ +120 EXP gained. A bond has deepened beyond the mortal realm—sacred, unbreakable.</em></p>
<<elseif $currentNPC.friendship gte 40>>
<p style="margin:15px 0; font-style:italic; color:#c9a961;">They pause, then nod with genuine interest. "I would welcome that," they say softly.</p>
<p style="margin:15px 0; color:#90EE90;">You walk together through the sect grounds as dusk settles. Conversation flows naturally between comfortable silences—stories of childhood, dreams half-formed, quiet observations about the nature of the Dao. Their laughter comes more freely than you have heard before, and your own heart feels lighter.</p>
<<set $currentNPC.friendship = Math.min(100, $currentNPC.friendship + random(10,17))>>
<<set $exp += 75>>
<<run _updateNPC()>>
<p style="color:#90EE90; margin-top:15px;"><em>✦ +75 EXP gained. Friendship moderately increased.</em></p>
<<else>>
<p style="margin:15px 0; font-style:italic; color:#c9a961;">They regard the offer with thoughtful hesitation, then offer a polite smile.</p>
<p><span style="color:#d4af37;">"Perhaps another time. We have not yet reached that threshold of closeness."</span></p>
<<set $currentNPC.friendship = Math.min(100, $currentNPC.friendship + random(2,5))>>
<<run _updateNPC()>>
<p style="color:#90EE90; margin-top:15px;"><em>✦ Friendship slightly increased.</em></p>
<</if>>
<<link "← Return">><<goto "RelationsDetailed">><</link>>
<!-- ==================== PARTNER ==================== -->
<<elseif $relationAction is "partner">>
<p style="margin:15px 0; color:#d4af37;">You lay bare your heart, proposing a bond beyond the ordinary—shared techniques, intertwined resources, a cultivation partnership where you rise together rather than in isolation.</p>
<<if $currentNPC.friendship gte 90 and $currentNPC.relationshipType isnot "enemy">>
<p style="margin:15px 0; font-style:italic; color:#c9a961;">The words you feared never come. Instead, their eyes glimmer with profound emotion—something between joy and relief.</p>
<<if $currentNPC.gender is "female">>
<p><span class="female" style="color:#ff69b4;">"Yes. I have waited for someone brave enough to speak such words. I would be honored beyond measure to walk this path with you, through every realm and beyond."</span></p>
<<else>>
<p><span class="male" style="color:#87ceeb;">"This is what my heart has hoped for. I would be honored to cultivate with you, to weather storms together, to share not just techniques but destiny itself."</span></p>
<</if>>
<<set $currentNPC.relationshipType to "partner">>
<<if not $playerRelations.lovers.includes($currentNPC.id)>>
<<set $playerRelations.lovers.push($currentNPC.id)>>
<</if>>
<<run _updateNPC()>>
<p style="color:#90EE90; margin-top:15px;"><em>✦ You are now cultivation partners! Profound unlocked—joint training, synchronization techniques, shared breakthroughs, and the possibility of perfect dual cultivation.</em></p>
<<elseif $currentNPC.friendship gte 60>>
<p style="margin:15px 0; font-style:italic; color:#c9a961;">Emotion flickers across their features. They step closer, but uncertainty clouds their eyes.</p>
<<if $currentNPC.gender is "female">>
<p><span class="female" style="color:#ff69b4;">"Such an offer... yes, it tempts me deeply. But I must be certain. Give me time to know you as fully as you deserve to be known. Then, perhaps, this dream might become real."</span></p>
<<else>>
<p><span class="male" style="color:#87ceeb;">"Your words stir something in my heart. But partnership at this level requires absolute trust. Allow me more time to build that certainty with you."</span></p>
<</if>>
<<set $currentNPC.friendship = Math.min(100, $currentNPC.friendship + 12)>>
<<run _updateNPC()>>
<p style="color:#90EE90; margin-top:15px;"><em>✦ They are moved by your sincerity. Continue deepening your bond.</em></p>
<<else>>
<p style="margin:15px 0; font-style:italic; color:#c9a961;">They regard you with kindness, but shake their head gently.</p>
<<if $currentNPC.gender is "female">>
<p><span class="female" style="color:#ff69b4;">"Such intimacy requires a foundation we have not yet built. I cannot give my heart to one I do not fully trust."</span></p>
<<else>>
<p><span class="male" style="color:#87ceeb;">"Your feelings honor me, but partnership is a sacred vow. We are not yet ready for such promises."</span></p>
<</if>>
<</if>>
<<link "← Return">><<goto "RelationsDetailed">><</link>>
<!-- ==================== MENTORSHIP ==================== -->
<<elseif $relationAction is "mentorship">>
<<if $currentNPC.realm gt $cultivationRealm or $currentNPC.NPCmartialArts gt $martialArts + 20>>
<p style="margin:15px 0; color:#d4af37;">You bow deeply, qi humble and open. "I have much to learn, and I sense in you the wisdom of one who has walked further on this path. Would you guide me?"</p>
<<if $currentNPC.friendship gte 70 and ($currentNPC.internalTrait is "Kind" or $currentNPC.internalTrait is "Upstanding" or $currentNPC.internalTrait is "Selfless")>>
<p style="margin:15px 0; font-style:italic; color:#c9a961;">Their expression transforms into something warm and purposeful. They place a hand on your shoulder, and you feel ancient knowledge humming beneath their touch.</p>
<<if $currentNPC.gender is "female">>
<p><span class="female" style="color:#ff69b4;">"It would be my privilege. I see in you the seeds of greatness. Allow me to help them bloom."</span></p>
<<else>>
<p><span class="male" style="color:#87ceeb;">"This is the path I have long hoped to walk. Your potential calls to me. I will teach you not just techniques, but the deeper truths behind them."</span></p>
<</if>>
<<set $currentNPC.mentorshipType to 1>>
<<run _updateNPC()>>
<p style="color:#90EE90; margin-top:15px;"><em>✦ You have gained a Master! They will unlock advanced techniques, offer breakthrough guidance, and share secrets of the Dao.</em></p>
<<if not $playerRelations.masters.includes($currentNPC.id)>>
<<set $playerRelations.masters.push($currentNPC.id)>>
<</if>>
<<if not $currentNPC.relations.apprentices.includes("player")>>
<<set $currentNPC.relations.apprentices.push("player")>>
<</if>>
<<elseif $currentNPC.friendship gte 50>>
<p style="margin:15px 0; font-style:italic; color:#c9a961;">They consider your request seriously, then offer a subtle nod.</p>
<<if $currentNPC.gender is "female">>
<p><span class="female" style="color:#ff69b4;">"Very well. I see promise in you worth cultivating. Prepare yourself to learn with discipline and respect."</span></p>
<<else>>
<p><span class="male" style="color:#87ceeb;">"I will teach you. Whether you can truly learn is another matter entirely. We shall see."</span></p>
<</if>>
<<set $currentNPC.mentorshipType to 1>>
<<run _updateNPC()>>
<p style="color:#90EE90; margin-top:15px;"><em>✦ You have gained a Mentor! Training begins.</em></p>
<<if not $playerRelations.masters.includes($currentNPC.id)>>
<<set $playerRelations.masters.push($currentNPC.id)>>
<</if>>
<<if not $currentNPC.relations.apprentices.includes("player")>>
<<set $currentNPC.relations.apprentices.push("player")>>
<</if>>
<<else>>
<p style="margin:15px 0; font-style:italic; color:#c9a961;">They study you with a measuring gaze, then shake their head slowly.</p>
<<if $currentNPC.gender is "female">>
<p><span class="female" style="color:#ff69b4;">"I do not accept students lightly. First, you must prove yourself worthy of my time."</span></p>
<<else>>
<p><span class="male" style="color:#87ceeb;">"Mentorship is earned, not granted. Return when you have demonstrated true dedication."</span></p>
<</if>>
<</if>>
<<else>>
<p style="margin:15px 0; color:#d4af37;">You offer to guide them in the Dao, positioning yourself as the senior in this relationship.</p>
<<if $currentNPC.friendship gte 60 and $currentNPC.realm lt $cultivationRealm>>
<p style="margin:15px 0; font-style:italic; color:#c9a961;">They bow deeply, eyes bright with respect and gratitude.</p>
<<if $currentNPC.gender is "female">>
<p><span class="female" style="color:#ff69b4;">"This junior would be deeply honored to receive guidance from such a powerful cultivator. I will learn with utmost diligence."</span></p>
<<else>>
<p><span class="male" style="color:#87ceeb;">"I am grateful for your generosity. I will not waste this opportunity."</span></p>
<</if>>
<<set $currentNPC.mentorshipType to 2>>
<<run _updateNPC()>>
<p style="color:#90EE90; margin-top:15px;"><em>✦ You have accepted an Apprentice! Nurture their growth and strengthen your own mastery.</em></p>
<<if not $playerRelations.apprentices.includes($currentNPC.id)>>
<<set $playerRelations.apprentices.push($currentNPC.id)>>
<</if>>
<<if not $currentNPC.relations.masters.includes("player")>>
<<set $currentNPC.relations.masters.push("player")>>
<</if>>
<<else>>
<p style="margin:15px 0; font-style:italic; color:#c9a961;">They offer a polite but firm decline.</p>
<p><span style="color:#d4af37;">"Your offer is gracious, but I must pursue my own path for now."</span></p>
<</if>>
<</if>>
<<link "← Return">><<goto "RelationsDetailed">><</link>>
<!-- ==================== GIFT ==================== -->
<<elseif $relationAction is "gift">>
<p style="margin:15px 0; color:#d4af37;">You present an offering, carefully chosen to resonate with their nature and values.</p>
<<if $currentNPC.externalTrait is "Glory hound">>
<p style="margin:15px 0; font-style:italic; color:#c9a961;">You select something impressive and public-worthy. They accept with obvious pleasure, already imagining how it will enhance their reputation.</p>
<p><span style="color:#ffd700;">"A gift befitting one of my standing. Excellent choice."</span></p>
<<elseif $currentNPC.externalTrait is "Family-oriented">>
<p style="margin:15px 0; font-style:italic; color:#c9a961;">You choose something that honors family—a protection charm, a precious stone from a sacred peak, or knowledge of a technique that strengthens bloodlines.</p>
<p><span style="color:#ff69b4;">"This... this will have a place of honor in our family shrine. You understand what matters most to me."</span></p>
<<elseif $currentNPC.externalTrait is "Romantic">>
<p style="margin:15px 0; font-style:italic; color:#c9a961;">Your gift carries beauty and meaning—perhaps a rare flower that blooms once in a century, or a handwritten poem that touches their heart.</p>
<p><span style="color:#ff69b4;">Their eyes soften, glistening slightly. "This is... truly beautiful. You have given me far more than an object. You have given me a memory I will cherish."</span></p>
<<else>>
<p style="margin:15px 0; font-style:italic; color:#c9a961;">You present something thoughtfully chosen. They receive it with genuine warmth.</p>
<p><span style="color:#d4af37;">"Your thoughtfulness is evident. I will treasure this."</span></p>
<</if>>
<<set $currentNPC.friendship = Math.min(100, $currentNPC.friendship + random(12,28))>>
<<run _updateNPC()>>
<p style="color:#90EE90; margin-top:15px;"><em>✦ Friendship greatly increased.</em></p>
<<if $currentNPC.depravity gte 60 and $corruption gte 40>>
<p style="margin:15px 0; font-style:italic; color:#8b0000;">As they admire the gift, their gaze lingers on you with sudden intensity. Something darker awakens in their expression—hunger of a nature neither purely virtuous nor entirely innocent.</p>
<p><span style="color:#ff1744;">"Your gift awakens certain... appetites within me. How interesting."</span></p>
<<set $currentNPC.depravity = Math.min(100, $currentNPC.depravity + random(3,8))>>
<<run _updateNPC()>>
<</if>>
<<link "← Return">><<goto "RelationsDetailed">><</link>>
<!-- ==================== SPAR ==================== -->
<<elseif $relationAction is "spar">>
<p style="margin:15px 0; color:#d4af37;">You challenge <<print $currentNPC.fullname>> to a duel, voice carrying respect rather than arrogance.</p>
<<if $currentNPC.friendship gte 50 or $currentNPC.externalTrait is "Glory hound">>
<<if $currentNPC.gender is "female">>
<p><span class="female" style="color:#ff69b4;">"At last! I have longed to test myself against you. Show me your strength!"</span></p>
<<else>>
<p><span class="male" style="color:#87ceeb;">"Your challenge honors me. I accept—let us see what we are truly made of."</span></p>
<</if>>
<p style="margin:15px 0; font-style:italic; color:#c9a961;">The world narrows to a single moment. You both step into a clearing where the space between you becomes a battlefield of pure potential.</p>
<p style="margin:15px 0; color:#d4af37;">Techniques clash in brilliant succession. Your weapon sings against theirs—sparks of qi dance like captured starlight. Sweat mingles with the heat of cultivation, and every breath comes heavy with exertion. The exchange is neither dance nor violence, but something sacred—two cultivators expressing their essence through combat.</p>
<<set _playerPower = $martialArts + random(1,35)>>
<<set _npcPower = $currentNPC.NPCmartialArts + random(1,35)>>
<<if _playerPower gte _npcPower>>
<p style="margin:15px 0; font-style:italic; color:#90EE90;">In the final exchange, your technique flows perfectly. You emerge victorious. Your opponent staggers back, breathing hard, then begins to laugh—a genuine, delighted sound.</p>
<<if $currentNPC.gender is "female">>
<p><span class="female" style="color:#ff69b4;">"Magnificent! You have grown far stronger. I am not ashamed to yield to you. This victory is earned."</span></p>
<<else>>
<p><span class="male" style="color:#87ceeb;">"Well fought. I see now why others speak of your potential with such reverence. You may indeed surpass me one day."</span></p>
<</if>>
<<set $exp += 180>>
<p style="color:#90EE90; margin-top:15px;"><em>✦ +180 EXP gained.</em></p>
<<else>>
<p style="margin:15px 0; font-style:italic; color:#d4af37;">Their superior technique gradually overwhelms yours. You find yourself retreating, adapting, learning with each failed counter. Finally, they catch your weapon and hold, victory absolute yet without cruelty.</p>
<<if $currentNPC.gender is "female">>
<p><span class="female" style="color:#ff69b4;">"You fought beautifully. Your foundation is solid—what you lack is refinement. With time and dedication, you will reach heights you cannot yet imagine."</span></p>
<<else>>
<p><span class="male" style="color:#87ceeb;">"You have skill and determination. This defeat is not failure—it is knowledge. Learn from it, and return stronger."</span></p>
<</if>>
<<set $exp += 140>>
<<if random(1,2) is 1>>
<<set $insight += 1>>
<p style="color:#90EE90; margin-top:15px;"><em>✦ +140 EXP gained. +1 Insight gained from glorious defeat.</em></p>
<<else>>
<<set $martialArts += 1>>
<p style="color:#90EE90; margin-top:15px;"><em>✦ +140 EXP gained. +1 Martial Arts mastery.</em></p>
<</if>>
<</if>>
<<set $currentNPC.friendship = Math.min(100, $currentNPC.friendship + random(10,20))>>
<<run _updateNPC()>>
<p style="color:#90EE90; margin-top:20px;"><em>✦ Friendship increased. A bond forged through honorable combat.</em></p>
<<else>>
<<if $currentNPC.gender is "female">>
<p><span class="female" style="color:#ff69b4;">"I do not engage in combat lightly. Prove yourself more worthy first."</span></p>
<<else>>
<p><span class="male" style="color:#87ceeb;">"Perhaps when we are better acquainted. I do not wish to injure a friend."</span></p>
<</if>>
<</if>>
<<link "← Return">><<goto "RelationsDetailed">><</link>>
<!-- ==================== DUAL CULTIVATION ==================== -->
<<elseif $relationAction is "dualCultivation">>
<div class="interaction-scene">
<<if $currentNPC.friendship gte 85 and $currentNPC.depravity gte 50 or ($currentNPC.relationshipType is "partner" or $currentNPC.relationshipType is "lover")>>
<p>The air between you crackles. You suggest merging qi in the most intimate way possible—not merely cultivation, but a complete joining of body, power, and will. Your eyes communicate everything: desire, possession, need.</p>
<<if $currentNPC.depravity gte 85>>
<<if $currentNPC.gender is "female">>
<p><span class="female">"Finally. My body has been burning for this since the moment I first felt your touch. I want every inch of you inside me while our qi merges. I want to scream your name as you make me come, over and over."</span></p>
<p>She pulls you into her private chamber, tearing at your robes with desperate hunger. She's liquid grace and controlled violence as she pushes you backward, her strength matching yours. Her hands grip you possessively as she whispers filthy promises against your skin.</p>
<<else>>
<p><span class="male">"I have been thinking about nothing but this—your body, your submission, the way you will feel wrapped around my cock while our powers merge. I want to claim every part of you."</span></p>
<p>He takes you with the intensity of someone who has been restraining themselves for far too long. His possession is clear, his hunger absolute. He positions you exactly as he wants, his control making it clear this is about mastery as much as pleasure.</p>
<</if>>
<<set $sexPartner to $currentNPC>>
<<set $sexType to "consensual_seduce">>
<<set $sexReturnPassage to "RelationsDetailed">>
<<set $currentNPC.depravity = Math.min(100, $currentNPC.depravity + random(2,5))>>
<<run _updateNPC()>>
<<link "Continue" "EncounterInteractionSex">><</link>>
<<elseif $currentNPC.depravity gte 70>>
<<if $currentNPC.gender is "female">>
<p><span class="female">"Yes. Let us merge completely. I want to feel you deep inside me, our qi flowing as one. Take me however you desire."</span></p>
<<else>>
<p><span class="male">"Yes. I want this more than cultivation itself. I want to feel your body, to be inside you, our powers ascending together."</span></p>
<</if>>
<<set $sexPartner to $currentNPC>>
<<set $sexType to "consensual_seduce">>
<<set $sexReturnPassage to "RelationsDetailed">>
<<set $currentNPC.depravity = Math.min(100, $currentNPC.depravity + random(2,5))>>
<<run _updateNPC()>>
<<link "Continue" "EncounterInteractionSex">><</link>>
<<else>>
<<if $currentNPC.gender is "female">>
<p><span class="female">"I want this. You. Let us ascend together with passion and reverence."</span></p>
<<else>>
<p><span class="male">"Let us merge our spirits in the most intimate way. You mean everything to me."</span></p>
<</if>>
<<set $sexPartner to $currentNPC>>
<<set $sexType to "consensual_seduce">>
<<set $sexReturnPassage to "RelationsDetailed">>
<<set $currentNPC.depravity = Math.min(100, $currentNPC.depravity + random(2,5))>>
<<run _updateNPC()>>
<<link "Continue" "EncounterInteractionSex">><</link>>
<</if>>
<<elseif $currentNPC.friendship gte 75 and $currentNPC.depravity gte 60>>
<p>You suggest dual cultivation, your voice heavy with desire and intention.</p>
<p>The suggestion hangs in the air. <<print $currentNPC.fullname>>'s eyes darken intensely, their breathing deepens. They step closer, and you can feel the heat radiating from them.</p>
<<if $currentNPC.gender is "female">>
<p><span class="female">"The idea makes my entire body ache with need. But we are not quite there yet. When we are partners in truth, we will do this—and it will break us both apart and remake us as one. Give me just a little more time."</span></p>
<<else>>
<p><span class="male">"I want that desperately. My body is responding to the mere thought. Soon—very soon—I will make you completely mine. Until then, your anticipation is exquisite torture."</span></p>
<</if>>
<<set $currentNPC.depravity += random(8,16)>>
<<set $currentNPC.friendship += random(12,20)>>
<p><strong style="color:#FFD700;">Friendship +<<print random(12,20)>> | Depravity +<<print random(8,16)>></strong></p>
<<elseif $currentNPC.friendship gte 60 and $currentNPC.depravity gte 50>>
<p>You suggest dual cultivation. <<print $currentNPC.fullname>>'s pupils dilate, and there's a moment where you can see raw desire war with their better judgment.</p>
<<if $currentNPC.gender is "female">>
<p><span class="female">"I want to. So badly. But not yet—let us be certain first. The promise of what we will do together... that alone is enough to keep me going."</span></p>
<<else>>
<p><span class="male">"You tempt me beyond measure. But I need our bond to be absolute first. When the time comes, I will be completely yours."</span></p>
<</if>>
<<set $currentNPC.depravity += random(6,12)>>
<<set $currentNPC.friendship += random(8,15)>>
<p><strong style="color:#90EE90;">Friendship +<<print random(8,15)>> | Depravity +<<print random(6,12)>></strong></p>
<<else>>
<p>You suggest dual cultivation. <<print $currentNPC.fullname>> steps back, clearly uncomfortable with the directness of the proposition.</p>
<<if $currentNPC.gender is "female">>
<p><span class="female">"Such intimacy requires far deeper connection and trust than we currently share. Please, do not ask this of me again until we have built something real."</span></p>
<<else>>
<p><span class="male">"I am honored by your desire, but such intimacy is sacred to me. Only when true trust and affection exist between us."</span></p>
<</if>>
<<set $currentNPC.friendship -= random(3,8)>>
<<set $currentNPC.depravity -= random(2,5)>>
<p><em>That may have been far too premature. They seem genuinely upset.</em></p>
<</if>>
</div>
<<link "Return" "RelationsDetailed">><<set $relationAction to null>><</link>>
<!-- ==================== DEBATE ==================== -->
<<elseif $relationAction is "debate">>
<p style="margin:15px 0; color:#d4af37;">You invite them into philosophical discourse—a clash of perspectives on the nature of the Dao, the right path for a cultivator, the balance between ambition and acceptance.</p>
<<if $currentNPC.NPCinsight gte $insight + 15>>
<p style="margin:15px 0; font-style:italic; color:#c9a961;">Their arguments flow like water around stone, each point cutting deeper than the last. Your logic, though sound, finds itself outmaneuvered by understanding that seems to come from a level beyond mere intellect.</p>
<p style="margin:15px 0; color:#d4af37;">Defeat settles around you, but it is a gift. In losing, you gain perspective you could never have found alone. Their wisdom opens doors in your mind you did not know existed.</p>
<<set $insight += random(2,4)>>
<<set $exp += 110>>
<p style="color:#90EE90; margin-top:15px;"><em>✦ +110 EXP gained. +2-4 Insight increased. Enlightenment comes through noble defeat.</em></p>
<<elseif $insight gte $currentNPC.NPCinsight + 15>>
<p style="margin:15px 0; font-style:italic; color:#c9a961;">Your logic unfolds flawlessly, each argument building upon the last like an unshakeable edifice. You watch their certainty gradually shift, their defenses carefully dismantled by reason rather than aggression.</p>
<p style="margin:15px 0; color:#d4af37;">When they finally concede, there is no shame in it—only respect. They nod slowly, genuinely moved by your perspective.</p>
<<if $currentNPC.gender is "female">>
<p><span class="female" style="color:#ff69b4;">"You have bested me through wisdom, not dominance. I bow to your greater understanding. This is a gift I will treasure."</span></p>
<<else>>
<p><span class="male" style="color:#87ceeb;">"Few have ever turned my own philosophy against me so effectively. You have earned my profound respect."</span></p>
<</if>>
<<set $currentNPC.friendship = Math.min(100, $currentNPC.friendship + random(12,22))>>
<<set $exp += 160>>
<<run _updateNPC()>>
<p style="color:#90EE90; margin-top:15px;"><em>✦ +160 EXP gained. Friendship greatly increased.</em></p>
<<else>>
<p style="margin:15px 0; font-style:italic; color:#c9a961;">A fierce and genuine exchange unfolds. Points are made and conceded, questions asked and answered. Neither emerges victorious, but both emerge transformed.</p>
<p style="margin:15px 0; color:#d4af37;">As the debate concludes, you both sit in satisfied silence—the profound kind that comes from being truly understood and challenged by another.</p>
<<set $exp += 130>>
<<set $currentNPC.friendship = Math.min(100, $currentNPC.friendship + random(5,10))>>
<<run _updateNPC()>>
<p style="color:#90EE90; margin-top:15px;"><em>✦ +130 EXP gained. Mutual understanding deepened.</em></p>
<</if>>
<<link "← Return">><<goto "RelationsDetailed">><</link>>
<</if>>
</div><<if $corruption >= $equippedRobe.corruptionLock and $corruption >= $equippedUnderwear.corruptionLock>>
<<link "Go back" $passage>><</link>>
<<else>>
<i>I should probably put some clothes on ...</i>
<</if>>
<<nobr>>
<<if $equippedRobe.class eq "naked">>
<p style="color:#8b0000; font-weight:bold;">There's no way I'm gonna talk to anyone naked!</p>
<<else>>
<<set $currentNPC to []>>
<<set $relationTab to $relationTab || "met">>
<<set $relationPage to $relationPage || 1>>
<<set _pageSize to 4>>
<div class="relations-container">
<h2 class="relations-title">Book of Connections</h2>
<p class="relations-subtitle">Fated encounters across the myriad realms...</p>
<!-- TAB NAVIGATION -->
<div class="relation-tabs">
<<link "Known (Met)">>
<<set $relationTab to "met">>
<<set $relationPage to 1>>
<<replace ".relations-grid">><<include "RelationsGrid">><</replace>>
<<replace ".pagination-container">><<include "RelationsPagination">><</replace>>
<</link>>
<<link "Discovered (Unmet)">>
<<set $relationTab to "unmet">>
<<set $relationPage to 1>>
<<replace ".relations-grid">><<include "RelationsGrid">><</replace>>
<<replace ".pagination-container">><<include "RelationsPagination">><</replace>>
<</link>>
<<link "Deceased">>
<<set $relationTab to "dead">>
<<set $relationPage to 1>>
<<replace ".relations-grid">><<include "RelationsGrid">><</replace>>
<<replace ".pagination-container">><<include "RelationsPagination">><</replace>>
<</link>>
<<link "All">>
<<set $relationTab to "all">>
<<set $relationPage to 1>>
<<replace ".relations-grid">><<include "RelationsGrid">><</replace>>
<<replace ".pagination-container">><<include "RelationsPagination">><</replace>>
<</link>>
</div>
<!-- Always include the grid container (empty message is handled by the widget) -->
<div class="relations-grid">
<<include "RelationsGrid">>
</div>
<!-- Always include pagination container -->
<div class="pagination-container">
<<include "RelationsPagination">>
</div>
</div>
<</if>>
<</nobr>><<link "Go back" $passage>><</link>>
<<nobr>>
<!-- SAFETY: If no ID selected, go back -->
<<if !$selectedNPCid>>
<<goto "Relations">>
<</if>>
<!-- Fetch the real NPC from list -->
<<set _npcIndex to $known_npc_list.findIndex(function(n) { return n.id is $selectedNPCid; })>>
<<if _npcIndex lt 0>>
<p style="color:red;">This connection no longer exists.</p>
<<goto "Relations">>
<</if>>
<<set $currentNPC to $known_npc_list[_npcIndex]>>
<<if $treeVisible is undefined>>
<<set $treeVisible = false>>
<</if>>
<div style="text-align:center; margin:15px 0;">
<<if $treeVisible>>
<<link "🌳 Hide Family Tree" "RelationsDetailed">>
<<set $treeVisible = false>>
<</link>>
<<else>>
<<link "🌳 Show Family Tree" "RelationsDetailed">>
<<set $treeVisible = true>>
<<DrawConnectionMap $currentNPC>>
<</link>>
<</if>>
</div>
<div id="tree-container">
<<if $treeVisible>>
<<DrawConnectionMap $currentNPC>>
<</if>>
</div>
<div class="relation-detail-container">
<div class="relation-header">
<img @src="'images/NPC/' + $currentNPC.gender + '/' + $currentNPC.npcPortrait + '.webp'" class="relation-portrait" alt="<<print $currentNPC.fullname>>">
<div class="relation-basics">
<h3><<print $currentNPC.fullname>>
<<if $currentNPC.isDead>> <span style="color:#8b0000; font-size:0.8em;">(Deceased)</span><</if>>
</h3>
<p><strong>Sex:</strong> <<print $currentNPC.gender>> •
<<if $currentNPC.isDead>>
<strong>Lifespan at death:</strong> <<print $currentNPC.NPClifespan>> / <<print $currentNPC.NPCmaxlifespan>>
<<else>>
<strong>Lifespan:</strong> <<print $currentNPC.NPClifespan>> / <<print $currentNPC.NPCmaxlifespan>>
<</if>></p>
<p><strong>Realm:</strong> <<print $currentNPC.realm>> • <strong>Position:</strong> <<print $currentNPC.NPCrank>> of <<print $currentNPC.sectNPC>></p>
<p><strong>Traits:</strong> <<print $currentNPC.internalTrait>> • <<print $currentNPC.externalTrait>></p>
<<if !$currentNPC.isDead>>
<p><strong>Location:</strong> <<print $currentNPC.NPClocation>></p>
<</if>>
<p><strong>Relationship:</strong> <<print $currentNPC.relationshipType>></p>
</div>
</div>
<<if $currentNPC.hasGrudge and !$currentNPC.isDead>>
<<set _grudgeInfo to $activeGrudges.find(function(g) { return g.avengerId === $currentNPC.id and g.active; })>>
<<if _grudgeInfo>>
<div class="grudge-warning">
<span class="red-text">⚠️ This cultivator holds a grudge against you! ⚠️</span><br>
<<if _grudgeInfo.type eq "rape">>
They seek vengeance for defiling <<print _grudgeInfo.victimName>>.
<<elseif _grudgeInfo.type eq "murder">>
They seek vengeance for the death of <<print _grudgeInfo.victimName>>.
<<elseif _grudgeInfo.type eq "seduction">>
They harbor jealousy over <<print _grudgeInfo.victimName>>.
<<elseif _grudgeInfo.type eq "humiliation">>
They seek to restore their honor after your insult.
<<else>>
They seek justice for your transgression.
<</if>>
<span class="small-text">(Seething with fury)</span>
</div>
<</if>>
<</if>>
<<if !$currentNPC.isDead>>
<<NPCMeter $currentNPC.friendship 100 "Friendship" "#4287f5">>
<<NPCMeter $currentNPC.depravity 100 "Depravity" "#a042f5">>
<</if>>
<p class="relation-flavor">
<<if $currentNPC.isDead>>
<!-- Dead NPC: check for custom death -->
<<if $currentNPC.killedByPlayer>>
<<if $currentNPC.killedInRevenge>>
You ended the life of <<print $currentNPC.fullname>>, who sought vengeance for
<<if $currentNPC.deathGrudgeVictim>>
<<print $currentNPC.deathGrudgeVictim>>
<<else>>
a perceived wrong
<</if>>.
Their blood is on your hands.
<<else>>
You slew <<print $currentNPC.fullname>> in battle. Their spirit may yet seek justice.
<</if>>
<<else>>
<!-- Default death flavor texts (modified to include cause if known) -->
<<set _deadFlavors to []>>
<<if $currentNPC.deathCause eq "old_age">>
<<set _deadFlavors = [
`${$currentNPC.fullname} passed peacefully of old age at ${$currentNPC.NPClocation}.`,
`The jianghu remembers ${$currentNPC.fullname}, who died of natural causes in ${$currentNPC.NPClocation}.`,
`Time claimed ${$currentNPC.fullname} in ${$currentNPC.NPClocation}. Their legend fades but is not forgotten.`
]>>
<<elseif $currentNPC.deathCause eq "murder">>
<<set _deadFlavors = [
`${$currentNPC.fullname} met a violent end at ${$currentNPC.NPClocation}. Whispers say they were ambushed.`,
`A bloodstained jade slip arrived from ${$currentNPC.NPClocation}: ${$currentNPC.fullname} was murdered.`,
`The cultivators of ${$currentNPC.NPClocation} speak of ${$currentNPC.fullname}'s untimely demise with hushed voices.`
]>>
<<else>>
<<set _deadFlavors = [
`The memory of ${$currentNPC.fullname} lingers like incense smoke... they passed from this world at ${$currentNPC.NPClocation}.`,
`A grave somewhere in ${$currentNPC.NPClocation} marks where ${$currentNPC.fullname} fell. Their story continues only in whispers.`,
`The Jianghu moves on, but ${$currentNPC.fullname}'s absence is still felt. They perished at ${$currentNPC.NPClocation}.`,
`Rumors say ${$currentNPC.fullname} met their end at ${$currentNPC.NPClocation}. Some speak of unfinished business...`,
`The soul of ${$currentNPC.fullname} has departed. Only echoes remain where they once walked in ${$currentNPC.NPClocation}.`,
`Ancestral tablets now bear ${$currentNPC.fullname}'s name. They fell at ${$currentNPC.NPClocation}.`,
`The spot where ${$currentNPC.fullname} died at ${$currentNPC.NPClocation} is said to be haunted by their lingering qi.`
]>>
<</if>>
<<print _deadFlavors.random()>>
<</if>>
<<else>>
<!-- Living NPC flavor texts (unchanged) -->
<<set _livingFlavors to [
`You've heard that ${$currentNPC.fullname} is currently at ${$currentNPC.NPClocation}.`,
`Word on the wind says ${$currentNPC.fullname} was last seen near ${$currentNPC.NPClocation}.`,
`Travelers mention spotting ${$currentNPC.fullname} around ${$currentNPC.NPClocation}.`,
`Rumors place ${$currentNPC.fullname} somewhere in ${$currentNPC.NPClocation}.`,
`A merchant claims to have traded with ${$currentNPC.fullname} recently at ${$currentNPC.NPClocation}.`,
`The spiritual energy near ${$currentNPC.NPClocation} bears traces of ${$currentNPC.fullname}'s presence.`,
`Someone matching ${$currentNPC.fullname}'s description was seen entering ${$currentNPC.NPClocation}.`
]>>
<<print _livingFlavors.random()>>
<</if>>
</p>
<!-- Only show interaction buttons if NPC is alive AND in same region -->
<<if !$currentNPC.isDead and $region eq $currentNPC.NPClocation>>
<div class="tab-nav">
<<link "Talk">><<goto "Relations Interactions">><<set $relationAction to "talk">><</link>>
<<link "Bond">><<goto "Relations Interactions">><<set $relationAction to "bond">><</link>>
<<link "Partner">><<goto "Relations Interactions">><<set $relationAction to "partner">><</link>>
<<link "Mentorship">><<goto "Relations Interactions">><<set $relationAction to "mentorship">><</link>>
<<link "Gift">><<goto "Relations Interactions">><<set $relationAction to "gift">><</link>>
<<link "Spar">><<goto "Relations Interactions">><<set $relationAction to "spar">><</link>>
<<link "Dual Cultivation">><<goto "Relations Interactions">><<set $relationAction to "dualCultivation">><</link>>
<<link "Debate">><<goto "Relations Interactions">><<set $relationAction to "debate">><</link>>
</div>
<<elseif $currentNPC.isDead>>
<!-- Memorial interactions for dead NPCs -->
<div class="memorial-actions" style="text-align:center; margin:20px 0; padding:15px; background:rgba(139,0,0,0.1); border-radius:10px;">
<p style="color:#8b0000; font-style:italic;">
<<= [
"You can only visit their grave and pay respects...",
"Their spirit has departed. Only memories remain.",
"The living must honor the dead through remembrance.",
"Perhaps one day you'll avenge them...",
"Their unfinished business calls to you from beyond."
].random() >>
</p>
<<linkreplace "Pay Respects">>
<<set $currentNPC.friendship to 100>>
<<set $exp += 5>>
<span style="color:#ffd700;">You honor their memory. +5 EXP</span>
<</linkreplace>>
</div>
<</if>>
<<if $NpcStatsVisible is undefined>>
<<set $NpcStatsVisible = false>>
<</if>>
<div style="text-align:center; margin:15px 0;">
<<if $NpcStatsVisible>>
<<link "Hide stats" "RelationsDetailed">>
<<set $NpcStatsVisible = false>>
<</link>>
<<else>>
<<link "Show stats" "RelationsDetailed">>
<<set $NpcStatsVisible = true>>
<<BookOfConnections_npcStats>>
<</link>>
<</if>>
</div>
<div id="stats-container">
<<if $NpcStatsVisible>>
<<BookOfConnections_npcStats>>
<</if>>
</div>
<div style="text-align:center; margin-top:30px;">
<<link "Return to Connections">><<goto "Relations">><</link>>
</div>
</div>
<</nobr>><<nobr>>
<<set _tab to $relationTab || "met">>
<!-- Filter based on selected tab -->
<<if _tab eq "met">>
<<set _filteredList to $known_npc_list.filter(n => n.isMet === true and !n.isDead)>>
<<elseif _tab eq "unmet">>
<<set _filteredList to $known_npc_list.filter(n => n.isMet === false and !n.isDead)>>
<<elseif _tab eq "dead">>
<<set _filteredList to $known_npc_list.filter(n => n.isDead === true)>>
<<else>>
<<set _filteredList to $known_npc_list>>
<</if>>
<<set _pageSize to 4>>
<<set _page to $relationPage || 1>>
<<set _totalPages to Math.ceil(_filteredList.length / _pageSize)>>
/* Ensure page is valid */
<<if _totalPages > 0>>
<<if _page > _totalPages>>
<<set _page to _totalPages>>
<<set $relationPage to _page>>
<</if>>
<<else>>
<<set _page to 1>>
<<set $relationPage to 1>>
<</if>>
<<if _page < 1>>
<<set _page to 1>>
<<set $relationPage to 1>>
<</if>>
<<set _start to (_page - 1) * _pageSize>>
<<set _end to Math.min(_start + _pageSize, _filteredList.length)>>
<<set _displayList to _filteredList.slice(_start, _end)>>
<<if _displayList.length gt 0>>
<<for _npc range _displayList>>
<<capture _npc>>
<div @class="'relation-card' + (_npc.isDead ? ' dead-card' : '')">
<div class="relation-name">
<<link _npc.fullname "RelationsDetailed">><<set $selectedNPCid to _npc.id>><</link>>
<<if _npc.isDead>> <span style="color:#8b0000;">✟</span><</if>>
</div>
<div class="relation-info">
<span class="location"><<print _npc.NPClocation>></span><br>
<<if !_npc.isMet and !_npc.isDead>>
<span style="color:#819ca9;">(Discovered but not met)</span><br>
<</if>>
<<RelationshipType>>
</div>
<<if !_npc.isDead>>
<<link "Forget this connection">>
<<RemoveNPC>>
<<goto "Relations">>
<</link>>
<</if>>
</div>
<</capture>>
<</for>>
<<else>>
<p style="text-align:center; color:#819ca9; font-style:italic; grid-column:span 3; padding:40px;">
<<if _tab eq "met">>You haven't met anyone yet...<<elseif _tab eq "unmet">>No discovered connections...<<elseif _tab eq "dead">>No one has passed from this world yet...<<else>>The book is empty...<</if>>
</p>
<</if>>
<</nobr>><<nobr>>
<<set _tab to $relationTab || "met">>
<!-- Filter based on selected tab -->
<<if _tab eq "met">>
<<set _filteredList to $known_npc_list.filter(n => n.isMet === true and !n.isDead)>>
<<elseif _tab eq "unmet">>
<<set _filteredList to $known_npc_list.filter(n => n.isMet === false and !n.isDead)>>
<<elseif _tab eq "dead">>
<<set _filteredList to $known_npc_list.filter(n => n.isDead === true)>>
<<else>>
<<set _filteredList to $known_npc_list>>
<</if>>
<<set _pageSize to 4>>
<<set _page to $relationPage || 1>>
<<set _totalPages to Math.ceil(_filteredList.length / _pageSize)>>
<!-- Ensure page is within bounds -->
<<if _page > _totalPages and _totalPages > 0>>
<<set _page to _totalPages>>
<<set $relationPage to _page>>
<</if>>
<!-- Show count info -->
<div style="text-align:center; color:#819ca9; font-size:0.9em; margin-bottom:10px;">
Showing <<= _filteredList.length >> connection<<if _filteredList.length != 1>>s<</if>>
<<if _totalPages > 1>> (Page <<= _page >> of <<= _totalPages >>)<</if>>
</div>
<!-- Pagination controls - always visible if multiple pages -->
<<if _totalPages > 1>>
<div style="display:flex; justify-content:center; align-items:center; gap:20px;">
<<if _page > 1>>
<<link "« Previous">>
<<set $relationPage to _page - 1>>
<<replace ".relations-grid">><<include "RelationsGrid">><</replace>>
<<replace ".pagination-container">><<include "RelationsPagination">><</replace>>
<</link>>
<<else>>
<span style="color:#555;">« Previous</span>
<</if>>
<span>Page <<= _page >> of <<= _totalPages >></span>
<<if _page < _totalPages>>
<<link "Next »">>
<<set $relationPage to _page + 1>>
<<replace ".relations-grid">><<include "RelationsGrid">><</replace>>
<<replace ".pagination-container">><<include "RelationsPagination">><</replace>>
<</link>>
<<else>>
<span style="color:#555;">Next »</span>
<</if>>
</div>
<<elseif _filteredList.length gt 0>>
<!-- Single page, show simple indicator -->
<div style="text-align:center; color:#555;">
<span style="color:#555;">« Previous</span>
<span style="margin:0 20px;">Page 1 of 1</span>
<span style="color:#555;">Next »</span>
</div>
<</if>>
<</nobr>><img src="images/Locations/BloodSandReach.webp" class="location-bg" style="width:80%; border: 1px solid #c5a059; border-radius: 0;">
<<set $region to "Blood Sand Reach">>
<<link "Hunt demonic beasts" "HuntBeasts|Region1">><<set $passage to passage()>><</link>>
<br>
<<link "Gather herbs" "HerbGatherLoop|BloodSandReach">><</link>>
<br>
<<link "Exit Blood Sand Reach" "Map|Region1">><<set $passage to passage()>><</link>><<set $loopPassage to passage()>>
<<set $region to "Blood Sand Reach">>
<img src="images/Character/herb_gather.png" class="location-bg" style="width:40%; border: 1px solid #c5a059; border-radius: 0;">
<h3>Blood Sand Reach — Gathering</h3>
<p>You crouch low and begin searching the cracked earth and dry scrub for anything worth taking.</p>
<<HerbGather>>
<br>
<<if _eventRoll lte 70>>
<<link "Keep gathering" "HerbGatherLoop|BloodSandReach">><</link>>
<br>
<<link "Return to Blood Sand Reach" "Blood Sand Reach">><</link>>
<</if>><img src="images/Locations/GreatPlains.webp" class="location-bg" style="width:80%; border: 1px solid #c5a059; border-radius: 0;">
<<set $region to "Great Plains">>
<<link "Hunt demonic beasts" "HuntBeasts|Region1">><<set $passage to passage()>><</link>>
<br>
<<link "Gather herbs" "HerbGatherLoop|GreatPlains">><</link>>
<br>
<<link "Exit Great Plains" "Map|Region1">><<set $passage to passage()>><</link>><<set $region to "Hundred Sorrows Mountain">>
<<set $loopPassage to passage()>>
<img src="images/Character/herb_gather.png" class="location-bg" style="width:40%; border: 1px solid #c5a059; border-radius: 0;">
<h3>Great Plains — Gathering</h3>
<p>You pick your way carefully along the rocky slope, eyes scanning the crevices and frozen pools for spirit herbs.</p>
<<HerbGather>>
<<if _eventRoll lte 70>>
<br>
<<link "Keep gathering" "HerbGatherLoop|GreatPlains">><</link>>
<br>
<<link "Return to Great Plains" "Great Plains">><</link>>
<</if>><img src="images/Locations/HundredSorrowsMountain.webp" class="location-bg" style="width:80%; border: 1px solid #c5a059; border-radius: 0;">
<<set $region to "Hundred Sorrows Mountain">>
<<link "Hunt demonic beasts" "HuntBeasts|Region1">><<set $passage to passage()>><</link>>
<br>
<<link "Gather herbs" "HerbGatherLoop|HundredSorrows">><</link>>
<br>
<<link "Exit Hundred Sorrows Mountain" "Map|Region1">><<set $passage to passage()>><</link>><<set $region to "Hundred Sorrows Mountain">>
<<set $loopPassage to passage()>>
<img src="images/Character/herb_gather.png" class="location-bg" style="width:40%; border: 1px solid #c5a059; border-radius: 0;">
<h3>Hundred Sorrows Mountain — Gathering</h3>
<p>You pick your way carefully along the rocky slope, eyes scanning the crevices and frozen pools for spirit herbs.</p>
<<HerbGather>>
<<if _eventRoll lte 70>>
<br>
<<link "Keep gathering" "HerbGatherLoop|HundredSorrows">><</link>>
<br>
<<link "Return to Hundred Sorrows Mountain" "Hundred Sorrows Mountain">><</link>>
<</if>><div style="text-align:center;">
<h2 class="town-title">翡翠溪镇</h2> <div style="font-size: 0.9em; color: #c5a059; margin-top:-5px;">— Jade Creek Town —</div>
<img src="images/Locations/JadeCreekTown.jpg" class="location-bg" style="width:80%; border: 1px solid #c5a059; border-radius: 0;">
</div>
<<set $PlayerLocation to passage()>>
<<nobr>>
<<set $city to passage(), $passage to passage(), $pe to 0>>
<<if $health lte 0>><<set $health to 1>><</if>>
/* Mini HUD Bar inside the same width as the grid */
<div style="max-width:400px; margin: 10px auto; display: flex; justify-content: space-between; font-size: 0.75em; border-bottom: 1px solid rgba(197, 160, 89, 0.4); padding-bottom: 3px;">
<span><span style="color:#d4af37;">◈</span> Spirit Stones: $gold</span>
<span><span style="color:#ff4d4d;">❤</span> Health: $health</span>
</div>
<div class="city-grid">
<<link '<span class="nav-card exit-btn">Leave Town</span>' "Map|Region1">><</link>>
<<link '<span class="nav-card">The Workshop</span>' "The Workshop">><</link>>
<<link '<span class="nav-card">Bounty Board</span>' "Bounty Board">><</link>>
<<link '<span class="nav-card">Tavern</span>' "Tavern">><</link>>
<<link '<span class="nav-card">Inn</span>' "Inn">><</link>>
<<link '<span class="nav-card">Market</span>' "Market">><</link>>
<<link '<span class="nav-card">Public Baths</span>' "Public Baths">><</link>>
<<link '<span class="nav-card">Brothel</span>' "Brothel">><</link>>
<<link '<span class="nav-card tournament-btn">⚔ Participate in Tournament ⚔</span>' "TournamentBoard">><</link>>
</div>
<</nobr>>/* Initialize the view if it doesn't exist yet */
<<if $LonePeakView is undefined>><<set $LonePeakView to "monument">><</if>>
<div class="monument-container">
<<if $LonePeakView is "monument">>
<div class="monument-title">The Stone of Recognition</div>
<p>At its center, a stone slab rises from the earth. Carved into its face are the names of those whose insight, effort, or support helped shape the path you now walk.</p>
<div class="monument-names">
Greeedium<br>
telotelo
</div>
<p style="margin-top: 15px;">— and all others whose hands guided the early climb. —</p>
<<else>>
<div class="monument-title">Altar of Divine Laws</div>
<p>Current World Law Alignment: <span style="color:#d4af37;">**v$CurrentGameVersion**</span></p>
<<if $gameVersion eq $CurrentGameVersion>>
<p style="color:#00ff00;"><b>You are aligned with the current world laws. Your cultivation journey is in harmony with the natural order.</b></p>
<<else>>
<p style="color:#ff0000;"><b>Your cultivation is out of sync with the current world laws. Consider realigning to ensure your progress is not hindered. Your World Law Alignment: <span style="color:#d4af37;">**v$gameVersion**</span></b></p><</if>>
<div class="city-grid" style="max-width:320px; border-color: #d4af37; margin: 0 auto;">
<<link '<span class="nav-card" style="color:#00ffff !important;">✨ Align with v0.16</span>' "LonePeak">>
<<set $gameVersion to 0.16>>
<<GameUpdateWidget-016>>
<</link>>
<<link '<span class="nav-card" style="color:#00ffff !important;">✨ Align with v0.17a</span>' "LonePeak">>
<<set $gameVersion to 0.17a>>
<<GameUpdateWidget-017a>>
<</link>>
<<link '<span class="nav-card" style="color:#00ffff !important;">✨ Align with v0.18</span>' "LonePeak">>
<<set $gameVersion to 0.18>>
<<set $CurrentGameVersion to 0.18>>
<<GameUpdateWidget-018>>
<</link>>
<<link '<span class="nav-card" style="color:#00ffff !important;">✨ Align with v0.19</span>' "LonePeak">>
<<set $gameVersion to 0.19>>
<<set $CurrentGameVersion to 0.19>>
<<GameUpdateWidget-019>>
<</link>>
</div>
<</if>>
<div class="monument-footer">
The wind is still. The mountain watches in silence...
</div>
</div>
<div class="city-grid" style="max-width: 440px;">
<<if $LonePeakView is "monument">>
/* Update the permanent variable and refresh */
<<link '<span class="nav-card">📜 Approach Altar</span>' "LonePeak">>
<<set $LonePeakView to "update">>
<</link>>
<<else>>
<<link '<span class="nav-card">⬅ Back to Names</span>' "LonePeak">>
<<set $LonePeakView to "monument">>
<</link>>
<</if>>
/* When leaving, reset the view so it's back to 'monument' next time you visit */
<<link '<span class="nav-card exit-btn">⬅ Descend Peak</span>' $passage>>
<<set $LonePeakView to "monument">>
<</link>>
</div><div id="map-container">
<<MapRender>>
</div>
<div id="event-container">
<<RegionEvents>>
<<NpcPosition>>
<<if $region is "Region1">><<MortalRealm>><<elseif $region is "Region2">><<SecondRealm>><</if>>
<<TurnsAge>>
<<MissionNotification>>
<<NPCRumours>>
<<MainStorylineWidget>>
<<AfterBattle>>
<<FameUpdater>>
<<WorldRumours>>
<<CheckRevengeEvents>>
</div>
<<if $MapRegion eq 1>>
<<set $PlayerLocation to "Region1">>
<</if>>
<<if $peopleVisible is true>>
<<set $peopleVisible = false>>
<</if>><<if $mainStage lt 1>>
<<CityGatesClosed>>
<<elseif $mainStage gte 1 and random(1,100) lt 15>>
<<CityGatesClosed>>
<<else>>
<div style="text-align:center;">
<h2 class="town-title">翡翠溪镇</h2> <div style="font-size: 0.9em; color: #c5a059; margin-top:-5px;">— $region —</div>
<img src="images/Locations/NorthernPhoenix City.jpg" class="location-bg" style="width:80%; border: 1px solid #c5a059; border-radius: 0;">
</div>
<<set $PlayerLocation to passage()>>
<<nobr>>
<<set $city to passage(), $passage to passage(), $pe to 0>>
<<if $health lte 0>><<set $health to 1>><</if>>
/* Mini HUD Bar inside the same width as the grid */
<div style="max-width:400px; margin: 10px auto; display: flex; justify-content: space-between; font-size: 0.75em; border-bottom: 1px solid rgba(197, 160, 89, 0.4); padding-bottom: 3px;">
<span><span style="color:#d4af37;">◈</span> Spirit Stones: $gold</span>
<span><span style="color:#ff4d4d;">❤</span> Health: $health</span>
</div>
<div class="city-grid">
<br><<link '<span class="nav-card exit-btn">Leave City</span>' "Map|Region1">><</link>>
<br><<link '<span class="nav-card">Common District</span>' "Common District">><</link>>
<<link '<span class="nav-card">Noble District</span>' "Noble District">><</link>>
<<link '<span class="nav-card">Government District</span>' "Government District">><</link>>
<<link '<span class="nav-card">Entertainment District</span>' "Entertainment District">><</link>>
</div>
<</nobr>>
<</if>><div style="text-align:center;">
<h2 class="town-title">翡翠溪镇</h2> <div style="font-size: 0.9em; color: #c5a059; margin-top:-5px;">— Common District —</div>
<img src="images/Locations/Common District.jpg" class="location-bg" style="width:80%; border: 1px solid #c5a059; border-radius: 0;">
</div>
You step into the heart of the city’s daily life, where crowds of cultivators, merchants, and mortals weave through busy streets. Stalls overflow with goods, inns call out for travelers, and the steady noise of commerce never truly fades.
<br><<link "Go back" $passage>><<set $pe to 0>><</link>>
<br><<link "Marketplace" "Common District|Marketplace">><<set $pe to 0>><</link>>
<br><<link "Inn" "Inn">><<set $pe to 0>><</link>>
<br><<link "Tavern" "Tavern">><<set $pe to 0>><</link>>
<br><<link "Restaurant" "Common District|Restaurant">><<set $pe to 0>><</link>>
<br><<link "Public baths" "Public Baths">><<set $pe to 0>><</link>>
<br><<link "Bounty hall" "Common District|Bounty hall">><<set $pe to 0>><</link>>
<br><<link "Bank" "Common District|Bank">><<set $pe to 0>><</link>><<if $pe eq 0>>
<img src="images/Locations/market.webp" class="location-bg" style="width:80%; border: 1px solid #c5a059; border-radius: 0;">
<br>You enter the bustling market square, where merchants hawk their wares and the air is thick with the scent of exotic spices and herbs. Colorful stalls line the streets, each offering unique items from across the realm.
<br><<link "Go back" "Common District">><<set $pe to 0>><</link>>
<br><<link "Spirit Beast Market" "Common District|Marketplace">><<set $pe to 1>><</link>>
<br><<link "Pill Pavilion" "Common District|Marketplace">><<set $pe to 11>><</link>>
<br><<link "Weapon Pavilion" "Common District|Marketplace">><<set $pe to 21>><</link>>
<br><<link "Silk Pavilion" "Common District|Marketplace">><<set $pe to 31>><</link>>
<<elseif $pe eq 1>>
/* ============================================================
BEAST MARKET — restock-gated, with clean post-purchase messaging
============================================================ */
/* ---- Restock check: refresh beasts every 6 solar terms (~3 months) ---- */
<<if $beastMarketRestockTermsSeen eq undefined>>
<<set $beastMarketRestockTermsSeen to -1>>
<</if>>
/* Build a monotonic term counter that survives the annual $turns reset */
<<set _termNames to [
"Start of Spring","Rain Water","Insects Awaken","Spring Equinox",
"Clear and Bright","Grain Rain","Start of Summer","Grain Buds",
"Grain in Ear","Summer Solstice","Minor Heat","Major Heat",
"Start of Autumn","End of Heat","White Dew","Autumn Equinox",
"Cold Dew","Frost's Descent","Start of Winter","Minor Snow",
"Major Snow","Winter Solstice","Minor Cold","Major Cold"
]>>
<<set _termIndex to _termNames.indexOf($currentTerm)>>
<<if _termIndex lt 0>><<set _termIndex to 0>><</if>>
<<set _lifetimeTerms to ($lifespan * 24) + _termIndex>>
<<if (_lifetimeTerms - $beastMarketRestockTermsSeen) gte 6>>
<<GenerateBeast>><<set _beast0 to clone(_newBeast)>>
<<GenerateBeast>><<set _beast1 to clone(_newBeast)>>
<<GenerateBeast>><<set _beast2 to clone(_newBeast)>>
<<GenerateBeast>><<set _beast3 to clone(_newBeast)>>
<<set $beastMarketShopBeasts to [_beast0, _beast1, _beast2, _beast3]>>
<<set $beastMarketRestockTermsSeen to _lifetimeTerms>>
<</if>>
<<set _shopBeasts to $beastMarketShopBeasts>>
/* Beast trader greeting */
<<set _greetings to [
"\"Take your time. A spirit beast is not a purchase — it's a covenant that outlasts most cultivation breakthroughs.\"",
"\"Every beast here was caught in the field. None were bred for docility. Keep that in mind when you get attached.\"",
"\"Your qi signature is unusual. A few of them reacted when you walked in.\" He doesn't say which ones. \"You'll figure it out.\"",
"\"Don't let the cage fool you. The cage is temporary. What's inside it is permanent.\"",
"\"Most cultivators want a beast that obeys. The ones who last want a beast that chooses to.\"",
"\"Bloodline isn't everything. I've seen Legendary beasts waste away with the wrong owner. I've seen Common beasts Evolve past anything on this table.\"",
"\"A beast companion changes how you fight, how you think, how you sleep.\" A pause. \"Especially how you sleep.\"",
"\"Some of these remember more lives than you've lived. Factor that in before you decide.\""
]>>
<<set $beasttrader to _greetings.random()>>
<p class="herb-gather-flavor">The market smells of warm fur, ozone, and something green underneath everything. Cages of varied sizes line the walls, some humming faintly with suppressed qi. A weathered man in leather-patched robes looks up from his ledger as you enter.</p>
<p class="herb-gather-flavor"><span class="male"> <<= $beasttrader>></span></p>
/* ---- Post-purchase callout, rendered ABOVE the table so it never clutters rows ---- */
<<if $beastMarketLastPurchase neq undefined>>
<div class="beast-purchase-callout">
<div class="beast-purchase-callout-title">✦ <<= $beastMarketLastPurchase.species>> <span class="beast-purchase-callout-bloodline">(<<= $beastMarketLastPurchase.bloodline>>)</span> has joined you</div>
<div class="beast-purchase-callout-line"><<= $beastMarketLastPurchase.line>></div>
</div>
<<unset $beastMarketLastPurchase>>
<</if>>
<div class="beast-market-table-wrap">
<table class="beast-market-table">
<thead>
<tr>
<th></th>
<th>Beast</th>
<th>Bloodline</th>
<th>Stage</th>
<th>Personality</th>
<th>Traits</th>
<th>Stat Bonus</th>
<th>Price</th>
<th></th>
</tr>
</thead>
<tbody>
<<for _i to 0; _i lt _shopBeasts.length; _i++>>
<<set _sb to _shopBeasts[_i]>>
<tr class="beast-market-row">
/* ── Beast image cell ── */
<td class="beast-img-cell">
<img @src="_sb.beastImage"
@alt="_sb.species"
class="beast-market-img"
onerror="this.src='images/Beasts/placeholder.webp'">
</td>
/* ── Name + rarity ── */
<td class="beast-name-cell">
<span class="beast-market-name"><<= _sb.species>></span><br>
<span class="beast-rarity-<<= _sb.rarity.toLowerCase()>>">[<<= _sb.rarity>>]</span>
</td>
/* ── Bloodline ── */
<td class="beast-bloodline-cell">
<<= _sb.bloodline>>
</td>
/* ── Stage ── */
<td class="beast-stage-cell">
<<= _sb.stage>>
</td>
/* ── Personality ── */
<td class="beast-personality-cell">
<<= _sb.personality>>
</td>
/* ── Traits ── */
<td class="beast-traits-cell">
<<= _sb.traits.join("<br>")>>
</td>
/* ── Price ── */
<td class="beast-price-cell">
<<= _sb.price>> ◈
</td>
/* ── Purchase button ── */
<td class="beast-action-cell">
<<if _sb.sold>>
<span class="beast-already-sold">Acquired</span>
<<elseif $gold gte _sb.price>>
<<capture _i, _sb>>
<<link "Purchase" "Common District|Marketplace">>
<<set $gold -= _sb.price>>
<<set $playerBeast.push(clone(_sb))>>
<<set $beastMarketShopBeasts[_i].sold to true>>
<<set _purchaseLines to [
"\"Good choice.\" He doesn't look surprised. \"It's been restless since yesterday. I think it was waiting for someone specific.\"",
"\"Take this.\" He slides a small feeding guide across the counter without looking up. \"The first three nights matter most. Stay close.\"",
"\"Don't establish dominance. Let it come to you on its terms. A beast that chooses its owner fights twice as hard and bonds twice as deep.\"",
"\"That one ignored every cultivator who came in this week.\" A pause. \"Until you.\"",
"\"It'll test you once in the first week. How you respond sets the terms for everything after. Everything.\"",
"\"Interesting choice.\" He makes a note in his ledger. \"That bloodline runs warm. You'll notice.\""
]>>
<<set $beastMarketLastPurchase to {
species: _sb.species,
bloodline: _sb.bloodline,
line: _purchaseLines.random()
}>>
<</link>>
<</capture>>
<<else>>
<span class="beast-cant-afford"><<= _sb.price - $gold>> ◈ short</span>
<</if>>
</td>
</tr>
<</for>>
</tbody>
</table>
</div>
<<set _termsUntilRestock to 6 - (_lifetimeTerms - $beastMarketRestockTermsSeen)>>
<<if _termsUntilRestock gt 0>>
<p class="beast-market-restock-note">New beasts arrive in roughly <<= _termsUntilRestock>> seasons.</p>
<</if>>
<<link "Leave" "Common District|Marketplace">><<set $pe to 0>><</link>>
<<elseif $pe eq 11>>
You step into the Pill Pavilion, shelves lined with labeled jars and the air thick with the smell of herbs, smoke, and something faintly metallic.
<div style="margin:20px 0; padding:15px; background:rgba(40,80,40,0.5); border:2px solid #ffd700; border-radius:10px;">
<br><<link "Go back" $passage>><<set $pe to 0>><</link>>
<br><<link "Chat with the pill master">>
<<set _talk to true>>
<<replace "#chat-output">>The pill master glances up and says: <span class="male1">"<<print $pillPavilionChat.random()>>"</span><</replace>><</link>>
<br><span id="chat-output"></span>
<br>
<br><<link "Browse pills" "Common District|Marketplace">><<set $pe to 12>><</link>>
</div>
<<elseif $pe eq 12>>
/* ---- Restock check: if the solar term has changed since last restock, pick a fresh random batch ---- */
<<if $currentTerm neq $pillpavilionLastRestockTerm>>
<<PillPavilionRestock>>
<<set $pillpavilionLastRestockTerm to $currentTerm>>
<</if>>
<div class="merchant-header">
<h2>Pill Pavilion</h2>
</div>
<<link "Return to Market" "Common District|Marketplace">><<set $pe to 0>><</link>>
You open your satchel to reveal your Spirit Stones: <strong><span class="gold-amount"><<print $gold>></span> Spirit Stones</strong>
<<nobr>>
<<if $purchase neq null>>
<p style="color: #4fc3f7; font-weight: bold; margin-top: 20px; text-align: center;">
<br>You have acquired <<print $purchase>>.
</p>
<<unset $purchase>>
<<unset $purchaseclass>>
<</if>>
<</nobr>>
/* ==================== CATEGORY FILTER TABS ==================== */
<<if $pillShopCategory eq undefined>><<set $pillShopCategory to "All">><</if>>
<div class="category-tabs" style="margin: 15px 0; text-align: center;">
<<if $pillShopCategory eq "All">>
<span style="display:inline-block; margin:0 5px; padding:6px 14px; background:#ffd700; color:#1a3a1a; border-radius:6px; font-weight:bold;">All</span>
<<else>>
<<link "All">><<set $pillShopCategory to "All">><<goto "Common District|Marketplace">><</link>>
<</if>>
<<if $pillShopCategory eq "Strength">>
<span style="display:inline-block; margin:0 5px; padding:6px 14px; background:#ffd700; color:#1a3a1a; border-radius:6px; font-weight:bold;">Strength</span>
<<else>>
<<link "Strength">><<set $pillShopCategory to "Strength">><<goto "Common District|Marketplace">><</link>>
<</if>>
<<if $pillShopCategory eq "Agility">>
<span style="display:inline-block; margin:0 5px; padding:6px 14px; background:#ffd700; color:#1a3a1a; border-radius:6px; font-weight:bold;">Agility</span>
<<else>>
<<link "Agility">><<set $pillShopCategory to "Agility">><<goto "Common District|Marketplace">><</link>>
<</if>>
<<if $pillShopCategory eq "Willpower">>
<span style="display:inline-block; margin:0 5px; padding:6px 14px; background:#ffd700; color:#1a3a1a; border-radius:6px; font-weight:bold;">Willpower</span>
<<else>>
<<link "Willpower">><<set $pillShopCategory to "Willpower">><<goto "Common District|Marketplace">><</link>>
<</if>>
<<if $pillShopCategory eq "Health">>
<span style="display:inline-block; margin:0 5px; padding:6px 14px; background:#ffd700; color:#1a3a1a; border-radius:6px; font-weight:bold;">Health</span>
<<else>>
<<link "Health">><<set $pillShopCategory to "Health">><<goto "Common District|Marketplace">><</link>>
<</if>>
<<if $pillShopCategory eq "Insight">>
<span style="display:inline-block; margin:0 5px; padding:6px 14px; background:#ffd700; color:#1a3a1a; border-radius:6px; font-weight:bold;">Insight</span>
<<else>>
<<link "Insight">><<set $pillShopCategory to "Insight">><<goto "Common District|Marketplace">><</link>>
<</if>>
<<if $pillShopCategory eq "Charisma">>
<span style="display:inline-block; margin:0 5px; padding:6px 14px; background:#ffd700; color:#1a3a1a; border-radius:6px; font-weight:bold;">Charisma</span>
<<else>>
<<link "Charisma">><<set $pillShopCategory to "Charisma">><<goto "Common District|Marketplace">><</link>>
<</if>>
<<if $pillShopCategory eq "Luck">>
<span style="display:inline-block; margin:0 5px; padding:6px 14px; background:#ffd700; color:#1a3a1a; border-radius:6px; font-weight:bold;">Luck</span>
<<else>>
<<link "Luck">><<set $pillShopCategory to "Luck">><<goto "Common District|Marketplace">><</link>>
<</if>>
<<if $pillShopCategory eq "Energy">>
<span style="display:inline-block; margin:0 5px; padding:6px 14px; background:#ffd700; color:#1a3a1a; border-radius:6px; font-weight:bold;">Energy</span>
<<else>>
<<link "Energy">><<set $pillShopCategory to "Energy">><<goto "Common District|Marketplace">><</link>>
<</if>>
<<if $pillShopCategory eq "Lifespan">>
<span style="display:inline-block; margin:0 5px; padding:6px 14px; background:#ffd700; color:#1a3a1a; border-radius:6px; font-weight:bold;">Lifespan</span>
<<else>>
<<link "Lifespan">><<set $pillShopCategory to "Lifespan">><<goto "Common District|Marketplace">><</link>>
<</if>>
<<if $pillShopCategory eq "SpiritualRoot">>
<span style="display:inline-block; margin:0 5px; padding:6px 14px; background:#ffd700; color:#1a3a1a; border-radius:6px; font-weight:bold;">Spiritual Root</span>
<<else>>
<<link "Spiritual Root">><<set $pillShopCategory to "SpiritualRoot">><<goto "Common District|Marketplace">><</link>>
<</if>>
<<if $pillShopCategory eq "MartialArts">>
<span style="display:inline-block; margin:0 5px; padding:6px 14px; background:#ffd700; color:#1a3a1a; border-radius:6px; font-weight:bold;">Martial Arts</span>
<<else>>
<<link "Martial Arts">><<set $pillShopCategory to "MartialArts">><<goto "Common District|Marketplace">><</link>>
<</if>>
<<if $pillShopCategory eq "Corruption">>
<span style="display:inline-block; margin:0 5px; padding:6px 14px; background:#ffd700; color:#1a3a1a; border-radius:6px; font-weight:bold;">Corruption</span>
<<else>>
<<link "Corruption">><<set $pillShopCategory to "Corruption">><<goto "Common District|Marketplace">><</link>>
<</if>>
<<if $pillShopCategory eq "Armor">>
<span style="display:inline-block; margin:0 5px; padding:6px 14px; background:#ffd700; color:#1a3a1a; border-radius:6px; font-weight:bold;">Armor</span>
<<else>>
<<link "Armor">><<set $pillShopCategory to "Armor">><<goto "Common District|Marketplace">><</link>>
<</if>>
</div>
/* ==================== FILTERED ITEM LIST ==================== */
<<set _filteredItems to []>>
<<for _fi to 0; _fi lt $pillpavilionInventory.length; _fi++>>
<<if $pillShopCategory eq "All" or $pillpavilionInventory[_fi].tag eq $pillShopCategory>>
<<set _filteredItems.push($pillpavilionInventory[_fi])>>
<</if>>
<</for>>
<<set _maxShown to 5>>
<table class="merchant-table">
<thead>
<tr>
<th>Pill Offerings</th>
<th style="width: 90px; text-align: center;">In Stock</th>
<th style="width: 150px; text-align: center;">Price</th>
<th style="width: 100px; text-align: center;">Purchase</th>
</tr>
</thead>
<tbody>
<<for _i to 0; _i lt _filteredItems.length; _i++>>
<<if _i lt _maxShown>>
<<set _item to _filteredItems[_i]>>
<<set _stockLeft to $pillpavilionStock[_item.id]>>
<tr>
<td>
<div class="item-name"><<print _i + 1>>. <<print _item.name>></div>
<div class="item-desc"><<print _item.description>></div>
</td>
<td style="text-align: center; vertical-align: middle;">
<<if _stockLeft lte 0>>
<span class="not-enough">Sold out</span>
<<else>>
<<print _stockLeft>>
<</if>>
</td>
<td style="text-align: center; vertical-align: middle;">
<div class="item-price"><<print _item.price>> Spirit Stones</div>
</td>
<td style="text-align: center; vertical-align: middle;">
<<if _stockLeft lte 0>>
<span class="not-enough">Sold out</span>
<<elseif _item.price gt $gold>>
<span class="not-enough">Not enough gold</span>
<<else>>
<<capture _item>>
<<link "Buy" "Common District|Marketplace">>
<<set _found to false>>
<<set _index to -1>>
<<for _j to 0; _j lt $playerpotioninventory.length; _j++>>
<<if $playerpotioninventory[_j].id === _item.id>>
<<set _found to true>>
<<set _index to _j>>
<<break>>
<</if>>
<</for>>
<<if _found>>
<<set $playerpotioninventory[_index].quantity += 1>>
<<else>>
<<set _newItem to clone(_item)>>
<<set _newItem.quantity to 1>>
<<set $playerpotioninventory.push(_newItem)>>
<</if>>
/* Deduct stock, gold, and show purchase message */
<<set $pillpavilionStock[_item.id] -= 1>>
<<set $gold -= _item.price>>
<<set $purchase to _item.name>>
<<set $purchaseclass to _item.class>>
<</link>>
<</capture>>
<</if>>
</td>
</tr>
<</if>>
<</for>>
</tbody>
</table>
<<if _filteredItems.length gt _maxShown>>
<p style="text-align:center; opacity:0.7; font-size:0.9em;">More <<print $pillShopCategory>> pills may be available another time.</p>
<</if>>
<<elseif $pe eq 21>>
/* ==================== SHOP PASSAGE ==================== */
<<elseif $pe eq 31>>
<<set $silkenPetalChat to [
"Phoenix silk doesn't just sit on the skin, it remembers the warmth of the wearer.",
"Every thread here was dyed with fire-lily extract. Took me a decade to get the shade right.",
"You've got good taste, wandering in here instead of those plain cotton stalls.",
"A robe says more about a cultivator than their sword does, in my experience.",
"I once outfitted a Nascent Soul elder. Never told her the discount was for the gossip, not her rank.",
"Careful with the duskflame cuts, dear. They're cut to slip, not to stay.",
"Spirit Stones well spent, if you ask me. Though I suppose I'm not impartial.",
"The gold thread in that phoenix robe was woven by my grandmother. Still holds its shine.",
"You'd be surprised how many disciples come in blushing and leave wearing something far bolder.",
"Silk this fine doesn't tear easy. Doesn't mean people don't try.",
"If the fabric warms unexpectedly, that's just residual qi. Mostly.",
"I keep the boldest pieces in the back. Ask nicely and maybe I'll show you."
]>>
You step into the Silken Petal Boutique, where Phoenix City's finest silks hang in dyed shades of ember and gold. The air smells faintly of sandalwood and warm cloth.
<div style="margin:20px 0; padding:15px; background:rgba(100,40,20,0.5); border:2px solid #ffd700; border-radius:10px;">
<br><<link "Go back" $passage>><<set $pe to 0>><</link>>
<br><<link "Chat with the boutique owner">>
<<set _talk to true>>
<<replace "#chat-output">>The boutique owner smiles warmly and says: <span class="female1">"<<print $silkenPetalChat.random()>>"</span><</replace>><</link>>
<br><span id="chat-output"></span>
<br>
<br><<link "Browse silks" "Common District|Marketplace">><<set $pe to 34>><<set $silkShopCategory to "robe">><</link>>
</div>
<<elseif $pe eq 34>>
<div class="merchant-header">
<h2>Silken Petal Boutique</h2>
</div>
<<link "Return to Market" "Common District|Marketplace">><<set $pe to 0>><</link>>
You open your satchel to reveal your Spirit Stones: <strong><span class="gold-amount"><<print $gold>></span> Spirit Stones</strong>
<<nobr>>
<<if $purchase neq null>>
<p style="color: #4fc3f7; font-weight: bold; margin-top: 20px; text-align: center;">
<br>You have acquired <<print $purchase>>.
</p>
<<unset $purchase>>
<<unset $purchaseclass>>
<</if>>
<</nobr>>
/* ==================== CATEGORY FILTER TABS ==================== */
<<if $silkShopCategory eq undefined>><<set $silkShopCategory to "robe">><</if>>
<div class="category-tabs" style="margin: 15px 0; text-align: center;">
<<if $silkShopCategory eq "robe">>
<span style="display:inline-block; margin:0 5px; padding:6px 16px; background:#ffd700; color:#3a2010; border-radius:6px; font-weight:bold;">Robes</span>
<<else>>
<<link "Robes">><<set $silkShopCategory to "robe">><<goto "Common District|Marketplace">><</link>>
<</if>>
<<if $silkShopCategory eq "underwear">>
<span style="display:inline-block; margin:0 5px; padding:6px 16px; background:#ffd700; color:#3a2010; border-radius:6px; font-weight:bold;">Underwear</span>
<<else>>
<<link "Underwear">><<set $silkShopCategory to "underwear">><<goto "Common District|Marketplace">><</link>>
<</if>>
<<if $silkShopCategory eq "accessory">>
<span style="display:inline-block; margin:0 5px; padding:6px 16px; background:#ffd700; color:#3a2010; border-radius:6px; font-weight:bold;">Accessories</span>
<<else>>
<<link "Accessories">><<set $silkShopCategory to "accessory">><<goto "Common District|Marketplace">><</link>>
<</if>>
</div>
/* ==================== FILTERED + PAGINATED ITEM LIST ==================== */
<<set _filteredItems to []>>
<<for _fi to 0; _fi lt $silkenpetalboutiqueInventory.length; _fi++>>
<<if $silkenpetalboutiqueInventory[_fi].class eq $silkShopCategory>>
<<set _filteredItems.push($silkenpetalboutiqueInventory[_fi])>>
<</if>>
<</for>>
<<set _maxShown to 5>>
<table class="merchant-table">
<thead>
<tr>
<th>Silk Offerings</th>
<th style="width: 150px; text-align: center;">Price</th>
<th style="width: 100px; text-align: center;">Purchase</th>
</tr>
</thead>
<tbody>
<<for _i to 0; _i lt _filteredItems.length; _i++>>
<<if _i lt _maxShown>>
<<set _item to _filteredItems[_i]>>
<tr>
<td>
<div class="item-name"><<print _i + 1>>. <<print _item.name>></div>
<div class="item-desc"><<print _item.description>></div>
</td>
<td style="text-align: center; vertical-align: middle;">
<div class="item-price"><<print _item.price>> Spirit Stones</div>
</td>
<td style="text-align: center; vertical-align: middle;">
<<if _item.price gt $gold>>
<span class="not-enough">Not enough gold</span>
<<else>>
<<capture _item>>
<<link "Buy" "Common District|Marketplace">>
<<set _targetArray to "">>
<<if _item.class eq "robe">>
<<set _targetArray to $robeInventory>>
<<elseif _item.class eq "underwear">>
<<set _targetArray to $underwearInventory>>
<<elseif _item.class eq "accessory">>
<<set _targetArray to $accessoryInventory>>
<</if>>
<<set _found to false>>
<<set _index to -1>>
<<for _j to 0; _j lt _targetArray.length; _j++>>
<<if _targetArray[_j].name === _item.name>>
<<set _found to true>>
<<set _index to _j>>
<<break>>
<</if>>
<</for>>
<<if _found and _targetArray[_index].hasOwnProperty('quantity')>>
<<set _targetArray[_index].quantity += 1>>
<<else>>
<<set _newItem to clone(_item)>>
<<set _targetArray.push(_newItem)>>
<</if>>
/* Deduct gold and show purchase message */
<<set $gold -= _item.price>>
<<set $purchase to _item.name>>
<<set $purchaseclass to _item.class>>
<</link>>
<</capture>>
<</if>>
</td>
</tr>
<</if>>
<</for>>
</tbody>
</table>
<<if _filteredItems.length gt _maxShown>>
<p style="text-align:center; opacity:0.7; font-size:0.9em;">More <<print $silkShopCategory>> items may be available another time.</p>
<</if>>
<</if>><div style="text-align:center;">
<h2 class="town-title">Phoenix City</h2> <div style="font-size: 0.9em; color: #c5a059; margin-top:-5px;">— Noble District —</div>
<img src="images/Locations/Noble District.jpg" class="location-bg" style="width:80%; border: 1px solid #c5a059; border-radius: 0;">
</div>
You arrive in an area of refined elegance, where polished estates and ornate pavilions line wide, pristine streets. Laughter from tea houses and courtyards drifts through the air, masking the subtle tension of status, pride, and hidden rivalry beneath the surface.
<<link "Go back" $passage>><<set $pe to 0>><</link>>
<br>[[Noble Estates]]
<br>[[Tea House]]
<br>[[Auction House]]
<br>[[Spirit Tea Pavilion]]
<br>[[Phoenix Garden]]
<br>[[Moon Viewing Pavilion]]
<br>[[Luxury Inn]]<<set $PlayerLocation to passage()>>
<div style="text-align:center;">
<h2 class="town-title">Noble Estates</h2>
<div style="font-size:0.9em; color:#c5a059; margin-top:-5px;">— Noble District —</div>
<img src="images/Locations/NobleEstates.jpg" class="location-bg" style="width:80%; border:1px solid #c5a059; border-radius:0;">
</div>
<p>The Noble Estates occupy the high ground of Phoenix City's northern quarter — walled compounds separated by manicured paths, each gate marked with clan crests in lacquered wood and bronze. The air here is different: quieter, cooler, carrying the scent of cultivated gardens rather than street food and incense. Guards in private livery stand at most gates, evaluating everyone who passes with the thoroughness of men paid specifically for that purpose.</p>
<p>The streets between estates are nearly empty in the way that wealth makes things empty — not abandoned, but curated.</p>
<<set _roll to random(1,100)>>
<<if _roll lte 20 and $totalFame gte 1001>>
<p>A gate opens as you pass — deliberate, timed to your approach. A servant steps out and bows.</p>
<p><span class="male2">"The Young Master of the Shen Estate extends his greetings and requests the honored cultivator's company for tea, if she is not otherwise engaged."</span></p>
<div class="choices" id="ne-event-choices">
<<link "Accept Young Master Shen's invitation">>
<<replace "#ne-event-choices">>
<p class="choice-taken">Accept Young Master Shen's invitation</p>
<p class="choice-taken">Decline — keep walking</p>
<</replace>>
<<replace "#ne-event-body">>
<p>The Shen Estate interior is immaculate — gardens arranged around a central pavilion, servants invisible until needed. Young Master Shen is perhaps twenty-five, handsome in the particular way of men who have never lacked for anything, and possessed of an intelligence he works not to make obvious.</p>
<p>The tea is extraordinary. The conversation is better — he knows the political landscape of Phoenix City in the particular detail of someone who has grown up inside it, and he shares it freely in the way of a man making an investment rather than a gift.</p>
<p>You leave with three names, two political debts he considers someone else's problem, and a standing invitation.</p>
<<startStatChanges>>
<<gainStat "PCfame" "PCfame" 5 0 99999 "Fame">>
<<gainStat "PCsectFame" "PCsectFame" 2 0 99999 "Sect Fame">>
<<showStatChanges>>
<</replace>>
<</link>>
<<link "Decline — keep walking">>
<<replace "#ne-event-choices">>
<p class="choice-taken">Accept Young Master Shen's invitation</p>
<p class="choice-taken">Decline — keep walking</p>
<</replace>>
<<replace "#ne-event-body">>
<p>You acknowledge the servant with a nod. <span class="player">"Another time."</span></p>
<p>He bows and withdraws. The gate closes without comment.</p>
<</replace>>
<</link>>
</div>
<span id="ne-event-body"></span>
<</if>>
<div class="city-grid">
<br><<link '<span class="nav-card exit-btn">← Noble District</span>' "Noble District">><</link>>
<br><<link '<span class="nav-card">Tea House</span>' "Tea House">><</link>>
<<link '<span class="nav-card">Auction House</span>' "Auction House">><</link>>
<<link '<span class="nav-card">Spirit Tea Pavilion</span>' "Spirit Tea Pavilion">><</link>>
<<link '<span class="nav-card">Phoenix Garden</span>' "Phoenix Garden">><</link>>
<<link '<span class="nav-card">Moon Viewing Pavilion</span>' "Moon Viewing Pavilion">><</link>>
<<link '<span class="nav-card">Luxury Inn</span>' "Luxury Inn">><</link>>
</div><<set $PlayerLocation to passage()>>
<div style="text-align:center;">
<h2 class="town-title">Tea House</h2>
<div style="font-size:0.9em; color:#c5a059; margin-top:-5px;">— Noble District —</div>
<img src="images/Locations/TeaHouse.jpg" class="location-bg" style="width:80%; border:1px solid #c5a059; border-radius:0;">
</div>
<p>The Noble District's tea house operates on the assumption that everyone inside it has time. Screens divide the interior into semi-private alcoves, each with its own clay pot, water source, and cushioned seating. The blend on offer today is written on a card in the server's hand — aged pu-erh, white peony, three seasonal specialties. No prices listed. The clientele does not ask about prices.</p>
<p>Conversation hums low in the adjacent alcoves. This is where Phoenix City's noble families conduct the business that doesn't go to the Government District — agreements reached over tea that neither party will ever put in writing.</p>
<<set _roll to random(1,100)>>
<<if _roll lte 30 and $totalFame gte 201>>
<p>The occupant of the alcove beside yours draws the screen back slightly. A woman — older, sect-marked robes, the posture of someone who has spent fifty years being correct about things. She glances at you.</p>
<p><span class="female2">"You're <<print $CurrentPcSectRank>> rank, unless I've lost my eye for it."</span> She pours without asking whether you want tea. <span class="female2">"Sit properly. I want to hear how a cultivator of your age ended up outside Phoenix City's gates on a day like this."</span></p>
<div class="choices" id="th2-event-choices">
<<link "Sit with her — talk">>
<<replace "#th2-event-choices">>
<p class="choice-taken">Sit with her — talk</p>
<p class="choice-taken">Decline politely</p>
<</replace>>
<<replace "#th2-event-body">>
<p>You sit. You talk — more than you intended to, which is either the tea or her particular talent for asking questions that feel like observations. By the end she knows the shape of your situation without knowing the specifics, and you know that she is Elder Madam Wei of the Starfall Auxiliary Sect and that she has been in Phoenix City for reasons she describes as <em>"administrative"</em> with the tone of someone who means <em>"complicated."</em></p>
<p>She gives you her tea-house seal and tells you to present it if you need access to certain conversations the city's official channels don't accommodate.</p>
<<startStatChanges>>
<<gainStat "PCsectFame" "PCsectFame" 5 0 99999 "Sect Fame">>
<<gainStat "PCfame" "PCfame" 3 0 99999 "Fame">>
<<showStatChanges>>
<</replace>>
<</link>>
<<link "Decline politely">>
<<replace "#th2-event-choices">>
<p class="choice-taken">Sit with her — talk</p>
<p class="choice-taken">Decline politely</p>
<</replace>>
<<replace "#th2-event-body">>
<p><span class="player">"I appreciate the tea. I'm not looking for conversation today."</span></p>
<p>She pulls the screen back closed without comment. You note that she doesn't seem offended — the response of someone who expected it as one of several equally acceptable outcomes.</p>
<</replace>>
<</link>>
</div>
<span id="th2-event-body"></span>
<</if>>
<div class="choices" id="th2-choices">
<<link "Order tea and sit quietly">>
<<replace "#th2-choices">>
<p class="choice-taken">Order tea and sit quietly</p>
<p class="choice-taken">Listen to the adjacent alcoves</p>
<p class="choice-taken">Ask the server about notable regulars</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#th2-body">>
<p>The aged pu-erh is everything the card promised. You sit with it for an hour and allow yourself the unusual experience of doing nothing purposeful. When you leave your qi is marginally more settled than when you arrived, which you are willing to attribute to the tea.</p>
<<startStatChanges>>
<<gainStat "PCcultivationFame" "PCcultivationFame" 1 0 99999 "Cultivation Fame">>
<<showStatChanges>>
<</replace>>
<</link>>
<<link "Listen to the adjacent alcoves">>
<<replace "#th2-choices">>
<p class="choice-taken">Order tea and sit quietly</p>
<p class="choice-taken">Listen to the adjacent alcoves</p>
<p class="choice-taken">Ask the server about notable regulars</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#th2-body">>
<<set _listen to random(1,100)>>
<<if _listen lte 40>>
<p>The screens are good but your hearing is better. The alcove to your left contains two men negotiating a grain storage contract with numbers that do not match the city's official supply records. You file this away. It may be useful or it may be none of your business — that distinction is, presently, still open.</p>
<<startStatChanges>>
<<gainStat "PCfame" "PCfame" 2 0 99999 "Fame">>
<<showStatChanges>>
<<else>>
<p>Two noble wives discussing a third noble wife's husband's recent trip to the Red Lantern District in considerable detail. You learn nothing useful but gain an appreciation for how thoroughly this city surveils itself.</p>
<</if>>
<</replace>>
<</link>>
<<link "Ask the server about notable regulars">>
<<replace "#th2-choices">>
<p class="choice-taken">Order tea and sit quietly</p>
<p class="choice-taken">Listen to the adjacent alcoves</p>
<p class="choice-taken">Ask the server about notable regulars</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#th2-body">>
<p>She is trained to deflect this question and does so gracefully. But she is also a person, and you ask in a way that acknowledges that, and the result is a short list of names and schedules delivered in a murmur while she refills your cup — not everything, but enough to know when certain people are present and when they are not.</p>
<<startStatChanges>>
<<gainStat "PCfame" "PCfame" 1 0 99999 "Fame">>
<<showStatChanges>>
<</replace>>
<</link>>
<<link "Leave">>
<<replace "#th2-choices">>
<p class="choice-taken">Order tea and sit quietly</p>
<p class="choice-taken">Listen to the adjacent alcoves</p>
<p class="choice-taken">Ask the server about notable regulars</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#th2-body">>
<p>You leave the tea house and its particular brand of civilized opacity behind.</p>
<</replace>>
<</link>>
</div>
<span id="th2-body"></span>
<br><<link '<span class="nav-card exit-btn">← Noble Estates</span>' "Noble Estates">><</link>><<set $PlayerLocation to passage()>>
<div style="text-align:center;">
<h2 class="town-title">Auction House</h2>
<div style="font-size:0.9em; color:#c5a059; margin-top:-5px;">— Noble District —</div>
<img src="images/Locations/AuctionHouse.jpg" class="location-bg" style="width:80%; border:1px solid #c5a059; border-radius:0;">
</div>
<p>The Auction House operates twice monthly under normal conditions, but the sealed city has created a secondary market — items that were meant to leave are now circulating internally, and the house has called an emergency session. The hall is formal: numbered cards, raised dais, a senior auctioneer with a voice that carries without apparent effort.</p>
<p>Today's lots include: three low-grade spirit weapons, a sealed cultivation manual from a dissolved sect, a set of formation plates of uncertain provenance, and a single high-grade qi-gathering stone that three separate attendees are trying to pretend they haven't noticed.</p>
<div class="choices" id="ah-choices">
<<link "Bid on the qi-gathering stone">>
<<replace "#ah-choices">>
<p class="choice-taken">Bid on the qi-gathering stone</p>
<p class="choice-taken">Bid on the cultivation manual</p>
<p class="choice-taken">Observe — look for undervalued lots</p>
<p class="choice-taken">Submit an item for auction</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#ah-body">>
<<set _bid to random(1,100)>>
<<if $gold lt 200>>
<p>The stone opens at 200 stones and climbs fast. You drop out before the second bid. The stone goes to a merchant in the third row for an amount that suggests either desperation or very specific plans.</p>
<<elseif _bid lte 40>>
<p>The bidding runs past what the stone is worth at 350 stones. You hold at 300 and let it go. Someone paid too much. The cultivator's lesson: sometimes the correct move is not acquiring the thing.</p>
<<startStatChanges>>
<<gainStat "PCcultivationFame" "PCcultivationFame" 1 0 99999 "Cultivation Fame">>
<<showStatChanges>>
<<else>>
<p>You win it at 280 — reasonable, possibly below market given current scarcity. The auctioneer hands it over with the practiced neutrality of a man who has transferred things worth a great deal to people worth less than the things.</p>
<<startStatChanges>>
<<loseStat "PCgold" "PCgold" 280 0 999999 "Spirit Stones">>
<<gainStat "PCcultivationFame" "PCcultivationFame" 5 0 99999 "Cultivation Fame">>
<<showStatChanges>>
<</if>>
<</replace>>
<</link>>
<<link "Bid on the cultivation manual">>
<<replace "#ah-choices">>
<p class="choice-taken">Bid on the qi-gathering stone</p>
<p class="choice-taken">Bid on the cultivation manual</p>
<p class="choice-taken">Observe — look for undervalued lots</p>
<p class="choice-taken">Submit an item for auction</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#ah-body">>
<<set _bid to random(1,100)>>
<<if $gold lt 80>>
<p>The manual opens at 80. You count your stones and shake your head.</p>
<<elseif _bid lte 50>>
<p>The manual goes to a sect elder's representative who bids without visible limit. Dissolved sect texts make certain people nervous. You watch it go and wonder what's in it.</p>
<<else>>
<p>You win the manual at 95 stones — nobody else bid aggressively, which is either because they don't know what sect it's from or because they do. You will find out when you read it.</p>
<<startStatChanges>>
<<loseStat "PCgold" "PCgold" 95 0 999999 "Spirit Stones">>
<<gainStat "PCcultivationFame" "PCcultivationFame" 3 0 99999 "Cultivation Fame">>
<<showStatChanges>>
<</if>>
<</replace>>
<</link>>
<<link "Observe — look for undervalued lots">>
<<replace "#ah-choices">>
<p class="choice-taken">Bid on the qi-gathering stone</p>
<p class="choice-taken">Bid on the cultivation manual</p>
<p class="choice-taken">Observe — look for undervalued lots</p>
<p class="choice-taken">Submit an item for auction</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#ah-body">>
<<set _obs to random(1,100)>>
<<if _obs lte 35>>
<p>The formation plates go uncontested at 40 stones — nobody in the room knows what they are. You do. You buy them quietly and leave before anyone thinks to ask why you wanted them.</p>
<<startStatChanges>>
<<loseStat "PCgold" "PCgold" 40 0 999999 "Spirit Stones">>
<<gainStat "PCcultivationFame" "PCcultivationFame" 4 0 99999 "Cultivation Fame">>
<<showStatChanges>>
<<else>>
<p>Nothing slips through unnoticed today. The room is full of competent people and the house's estimates are accurate. You leave having spent nothing and acquired nothing, which is still a form of discipline.</p>
<</if>>
<</replace>>
<</link>>
<<link "Submit an item for auction">>
<<replace "#ah-choices">>
<p class="choice-taken">Bid on the qi-gathering stone</p>
<p class="choice-taken">Bid on the cultivation manual</p>
<p class="choice-taken">Observe — look for undervalued lots</p>
<p class="choice-taken">Submit an item for auction</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#ah-body">>
<p>The assessor examines what you've brought with the focused attention of someone whose entire value is accuracy. He names a reserve price. The house takes fifteen percent of final sale.</p>
<p>It sells at the reserve. Not exciting, but honest.</p>
<<startStatChanges>>
<<gainStat "PCgold" "PCgold" 60 0 999999 "Spirit Stones">>
<<gainStat "PCfame" "PCfame" 1 0 99999 "Fame">>
<<showStatChanges>>
<</replace>>
<</link>>
<<link "Leave">>
<<replace "#ah-choices">>
<p class="choice-taken">Bid on the qi-gathering stone</p>
<p class="choice-taken">Bid on the cultivation manual</p>
<p class="choice-taken">Observe — look for undervalued lots</p>
<p class="choice-taken">Submit an item for auction</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#ah-body">>
<p>The bidding continues without you.</p>
<</replace>>
<</link>>
</div>
<span id="ah-body"></span>
<br><<link '<span class="nav-card exit-btn">← Noble Estates</span>' "Noble Estates">><</link>><<set $PlayerLocation to passage()>>
<div style="text-align:center;">
<h2 class="town-title">Spirit Tea Pavilion</h2>
<div style="font-size:0.9em; color:#c5a059; margin-top:-5px;">— Noble District —</div>
<img src="images/Locations/SpiritTeaPavilion.jpg" class="location-bg" style="width:80%; border:1px solid #c5a059; border-radius:0;">
</div>
<p>Different from the Tea House in the way a cultivation hall differs from a library — the same category of activity, but the intent is entirely different. The Spirit Tea Pavilion uses teas grown in qi-rich soil, prepared by a cultivator-trained tea master, and served in quantities calibrated to the drinker's current cultivation level. The effect isn't medicinal and isn't intoxicating — it's clarifying, in the way a high altitude is clarifying. Your thoughts become slightly more your own.</p>
<p>The tea master — a lean man of perhaps sixty, cultivation level unreadable — glances at you and begins preparing without being asked.</p>
<div class="choices" id="stp-choices">
<<link "Take the full session (80 stones)">>
<<replace "#stp-choices">>
<p class="choice-taken">Take the full session (80 stones)</p>
<p class="choice-taken">Single cup only (20 stones)</p>
<p class="choice-taken">Speak with the tea master</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#stp-body">>
<<if $gold lt 80>>
<p>He names the price without looking up. You count your stones and decline.</p>
<<else>>
<p>Three hours. Seven cups, each different, each building on the last. By the final cup your meridians feel as though they've been aired out — not healed, not advanced, but cleared of the specific kind of cultivation debris that accumulates from ordinary living. You leave lighter than you arrived in a way that has nothing to do with weight.</p>
<<startStatChanges>>
<<loseStat "PCgold" "PCgold" 80 0 999999 "Spirit Stones">>
<<gainStat "PCcultivationFame" "PCcultivationFame" 5 0 99999 "Cultivation Fame">>
<<showStatChanges>>
<</if>>
<</replace>>
<</link>>
<<link "Single cup only (20 stones)">>
<<replace "#stp-choices">>
<p class="choice-taken">Take the full session (80 stones)</p>
<p class="choice-taken">Single cup only (20 stones)</p>
<p class="choice-taken">Speak with the tea master</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#stp-body">>
<<if $gold lt 20>>
<p>He names the price. You're short. He pours a quarter cup anyway and waves you off when you try to pay for it. <span class="male2">"For the road,"</span> he says. You don't argue.</p>
<<else>>
<p>One cup — green-gold in the bowl, smelling of high elevation and something floral you can't name. It settles in your chest like a decision made correctly. Twenty stones well spent.</p>
<<startStatChanges>>
<<loseStat "PCgold" "PCgold" 20 0 999999 "Spirit Stones">>
<<gainStat "PCcultivationFame" "PCcultivationFame" 2 0 99999 "Cultivation Fame">>
<<showStatChanges>>
<</if>>
<</replace>>
<</link>>
<<link "Speak with the tea master">>
<<replace "#stp-choices">>
<p class="choice-taken">Take the full session (80 stones)</p>
<p class="choice-taken">Single cup only (20 stones)</p>
<p class="choice-taken">Speak with the tea master</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#stp-body">>
<p>He listens to your questions while his hands continue working — rinsing, measuring, heating — in the way of someone for whom the hands and the mind are separate systems. His answers are short and accurate. He has read your cultivation level from the way you breathe and is telling you things specific to that level without asking what it is.</p>
<p>You leave with two pieces of practical advice that will take you weeks to properly use.</p>
<<startStatChanges>>
<<gainStat "PCcultivationFame" "PCcultivationFame" 3 0 99999 "Cultivation Fame">>
<<showStatChanges>>
<</replace>>
<</link>>
<<link "Leave">>
<<replace "#stp-choices">>
<p class="choice-taken">Take the full session (80 stones)</p>
<p class="choice-taken">Single cup only (20 stones)</p>
<p class="choice-taken">Speak with the tea master</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#stp-body">>
<p>You leave the pavilion and its particular quiet behind.</p>
<</replace>>
<</link>>
</div>
<span id="stp-body"></span>
<br><<link '<span class="nav-card exit-btn">← Noble Estates</span>' "Noble Estates">><</link>><<set $PlayerLocation to passage()>>
<div style="text-align:center;">
<h2 class="town-title">Phoenix Garden</h2>
<div style="font-size:0.9em; color:#c5a059; margin-top:-5px;">— Noble District —</div>
<img src="images/Locations/PhoenixGarden.jpg" class="location-bg" style="width:80%; border:1px solid #c5a059; border-radius:0;">
</div>
<p>The Phoenix Garden is the Noble District's public concession to beauty — the City Lord's family maintains it but opens it during daylight hours to those who can pass the gate register. The gate register is, in practice, a height-of-cultivation check and a face-check, neither of which you fail. Inside: tiered stone paths through sculpted rockery, red maple and white plum, a central pond with pavilion access, and the particular dense silence of a space where qi has been cultivated into the earth itself over generations.</p>
<p>A few nobles walk the paths in small groups. Two elderly cultivators occupy the pond pavilion in what appears to be a very slow, very intentional argument conducted entirely through Go moves.</p>
<<set _roll to random(1,100)>>
<<if _roll lte 25 and $sexFame gte 100>>
<p>A young nobleman falls into step beside you on the narrower upper path — not accidentally. He is handsome, knows it, and has clearly spent the morning deciding to talk to you.</p>
<p><span class="male1">"I've been watching you walk the path twice,"</span> he says. <span class="male1">"You move like someone with somewhere to be, which makes me curious why you're in a garden."</span></p>
<div class="choices" id="pg-event-choices">
<<link "Engage — this could go somewhere">>
<<replace "#pg-event-choices">>
<p class="choice-taken">Engage — this could go somewhere</p>
<p class="choice-taken">Dismiss him cleanly</p>
<</replace>>
<<replace "#pg-event-body">>
<p><span class="player">"Maybe I found something worth slowing down for."</span></p>
<p>He has the grace to look genuinely pleased rather than smug. His family estate borders the garden — accessible, as it turns out, through a gate at the northern wall that he has a key to. The afternoon that follows in his private courtyard is unhurried, agreeable, and completely free of the power dynamics that characterize most of your interactions with men of his class. He is simply a pleasant young man with an afternoon and good taste in both architecture and company.</p>
/* === IMAGE: private noble courtyard, afternoon light through maple trees, young nobleman attentive, Zyanbai at ease === */
<<startStatChanges>>
<<gainStat "PCsexFame" "PCsexFame" 2 0 99999 "Sex Fame">>
<<gainStat "PCfame" "PCfame" 1 0 99999 "Fame">>
<<showStatChanges>>
<</replace>>
<</link>>
<<link "Dismiss him cleanly">>
<<replace "#pg-event-choices">>
<p class="choice-taken">Engage — this could go somewhere</p>
<p class="choice-taken">Dismiss him cleanly</p>
<</replace>>
<<replace "#pg-event-body">>
<p><span class="player">"I'm here for the garden."</span> You don't slow your pace. He gets the message and peels off without making it awkward — points for that, at least.</p>
<</replace>>
<</link>>
</div>
<span id="pg-event-body"></span>
<</if>>
<div class="choices" id="pg-choices">
<<link "Walk the full garden path">>
<<replace "#pg-choices">>
<p class="choice-taken">Walk the full garden path</p>
<p class="choice-taken">Meditate at the pond pavilion</p>
<p class="choice-taken">Observe the Go players</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#pg-body">>
<p>The upper path circles the garden twice before descending to the pond level. The qi density in the soil is genuine — old, layered, the kind that accumulates not through any single cultivation act but through a hundred years of deliberate care. You feel your own cultivation respond to it mildly, the way lungs respond to good air.</p>
<<startStatChanges>>
<<gainStat "PCcultivationFame" "PCcultivationFame" 2 0 99999 "Cultivation Fame">>
<<showStatChanges>>
<</replace>>
<</link>>
<<link "Meditate at the pond pavilion">>
<<replace "#pg-choices">>
<p class="choice-taken">Walk the full garden path</p>
<p class="choice-taken">Meditate at the pond pavilion</p>
<p class="choice-taken">Observe the Go players</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#pg-body">>
<p>The pavilion is empty save for the Go players at the far end, who ignore you with the comprehensive attention of men entirely inside their own game. You sit and let the garden's ambient qi settle around your own. An hour passes without you deciding to let it. When you open your eyes the light has shifted and you feel rested in the specific way that has nothing to do with sleep.</p>
<<startStatChanges>>
<<gainStat "PCcultivationFame" "PCcultivationFame" 4 0 99999 "Cultivation Fame">>
<<showStatChanges>>
<</replace>>
<</link>>
<<link "Observe the Go players">>
<<replace "#pg-choices">>
<p class="choice-taken">Walk the full garden path</p>
<p class="choice-taken">Meditate at the pond pavilion</p>
<p class="choice-taken">Observe the Go players</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#pg-body">>
<p>They are playing something that is not quite Go — the board is standard but their qi is faintly active with each placement, the stones shifted by intent fractions of a second before their hands move. You watch for twenty minutes before one of them, without looking up: <span class="male2">"She sees the qi-layer. Sit down if you want to learn it properly."</span></p>
<p>You sit down.</p>
<<startStatChanges>>
<<gainStat "PCcultivationFame" "PCcultivationFame" 3 0 99999 "Cultivation Fame">>
<<gainStat "PCfame" "PCfame" 2 0 99999 "Fame">>
<<showStatChanges>>
<</replace>>
<</link>>
<<link "Leave">>
<<replace "#pg-choices">>
<p class="choice-taken">Walk the full garden path</p>
<p class="choice-taken">Meditate at the pond pavilion</p>
<p class="choice-taken">Observe the Go players</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#pg-body">>
<p>You leave the garden through the same gate you entered. The keeper logs your departure without comment.</p>
<</replace>>
<</link>>
</div>
<span id="pg-body"></span>
<br><<link '<span class="nav-card exit-btn">← Noble Estates</span>' "Noble Estates">><</link>><<set $PlayerLocation to passage()>>
<div style="text-align:center;">
<h2 class="town-title">Moon Viewing Pavilion</h2>
<div style="font-size:0.9em; color:#c5a059; margin-top:-5px;">— Noble District —</div>
<img src="images/Locations/MoonViewingPavilion.jpg" class="location-bg" style="width:80%; border:1px solid #c5a059; border-radius:0;">
</div>
<p>The Moon Viewing Pavilion is only fully alive at night — a tiered structure at the Noble District's highest point, open on all sides, its white stone deliberately chosen to catch and hold moonlight. During the day it is quiet and underused, occupied by a single caretaker and whatever guests want the elevated view of the city's sealed skyline. At night it is a different space entirely — the city's wealthy come here for poetry gatherings, private meetings conducted with the plausible deniability of chance encounters, and the particular variety of romance that requires a good view to feel justified.</p>
<p>You arrive at dusk. The caretaker lights the lanterns without being asked.</p>
<<set _roll to random(1,100)>>
<<if _roll lte 30 and $sexFame gte 100>>
<p>Another early arrival is already at the pavilion's highest tier — a cultivator in sect robes, standing at the railing and watching the city lights come on below. He hears you on the stairs and doesn't turn immediately, which is either confidence or courtesy. When he does turn: sect-marked, older than you, the kind of face that has spent decades being precise.</p>
<p><span class="male1">"I come here to think,"</span> he says. <span class="male1">"You?"</span></p>
<div class="choices" id="mvp-event-choices">
<<link "Stay — see where the conversation goes">>
<<replace "#mvp-event-choices">>
<p class="choice-taken">Stay — see where the conversation goes</p>
<p class="choice-taken">Give him his quiet back</p>
<</replace>>
<<replace "#mvp-event-body">>
<p><span class="player">"Same."</span> You take the railing beside him. The city below finishes lighting itself in stages.</p>
<p>The conversation starts as cultivation theory and becomes something else around the second hour, which neither of you acknowledges directly until it is already something else. The pavilion is private enough, and the night is long enough, and he proves to be the kind of man who approaches everything with the same focused deliberateness he brings to sect work — which is, you find, an extremely transferable quality.</p>
<p>He leaves before the moon reaches its height. <span class="male1">"Same time tomorrow,"</span> he says, as a statement rather than a question.</p>
<p><span class="player">"Perhaps,"</span> you say. Same answer as always.</p>
/* === IMAGE: Moon Viewing Pavilion upper tier, moonlight, older cultivator, Zyanbai at the railing, intimate distance === */
<<startStatChanges>>
<<gainStat "PCsexFame" "PCsexFame" 2 0 99999 "Sex Fame">>
<<gainStat "PCcultivationFame" "PCcultivationFame" 2 0 99999 "Cultivation Fame">>
<<showStatChanges>>
<</replace>>
<</link>>
<<link "Give him his quiet back">>
<<replace "#mvp-event-choices">>
<p class="choice-taken">Stay — see where the conversation goes</p>
<p class="choice-taken">Give him his quiet back</p>
<</replace>>
<<replace "#mvp-event-body">>
<p><span class="player">"Same."</span> You take the opposite railing. He nods once and returns to looking at the city. You both watch it get dark in companionable and completely separate silence.</p>
<</replace>>
<</link>>
</div>
<span id="mvp-event-body"></span>
<</if>>
<div class="choices" id="mvp-choices">
<<link "Watch the city from the upper tier">>
<<replace "#mvp-choices">>
<p class="choice-taken">Watch the city from the upper tier</p>
<p class="choice-taken">Meditate under the moonlight</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#mvp-body">>
<p>Phoenix City below you: lantern-light spreading district by district as the sun finishes setting, the sealed gate visible from here as a faint darkness where the outer ward should glow. From up here the city's internal logic becomes visible — which districts are busy, which are quiet, which buildings sit on older foundations that slightly misalign the newer streets around them.</p>
<p>You file everything useful and leave the rest to be beautiful.</p>
<<startStatChanges>>
<<gainStat "PCfame" "PCfame" 1 0 99999 "Fame">>
<<showStatChanges>>
<</replace>>
<</link>>
<<link "Meditate under the moonlight">>
<<replace "#mvp-choices">>
<p class="choice-taken">Watch the city from the upper tier</p>
<p class="choice-taken">Meditate under the moonlight</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#mvp-body">>
<p>Moonlight cultivation is a minor tradition in several sect lineages — the moon's qi is yin-aspected, slower than solar cultivation but cleaner. You sit on the white stone and let the light settle into your cultivation base in the unhurried way of something that works but cannot be rushed.</p>
<p>Two hours pass. Not wasted.</p>
<<startStatChanges>>
<<gainStat "PCcultivationFame" "PCcultivationFame" 4 0 99999 "Cultivation Fame">>
<<showStatChanges>>
<</replace>>
<</link>>
<<link "Leave">>
<<replace "#mvp-choices">>
<p class="choice-taken">Watch the city from the upper tier</p>
<p class="choice-taken">Meditate under the moonlight</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#mvp-body">>
<p>You descend the pavilion stairs as the city finishes waking up to its evening self below.</p>
<</replace>>
<</link>>
</div>
<span id="mvp-body"></span>
<br><<link '<span class="nav-card exit-btn">← Noble Estates</span>' "Noble Estates">><</link>><<set $PlayerLocation to passage()>>
<div style="text-align:center;">
<h2 class="town-title">The Vermilion Crane Inn</h2>
<div style="font-size:0.9em; color:#c5a059; margin-top:-5px;">— Noble District —</div>
<img src="images/Locations/LuxuryInn.jpg" class="location-bg" style="width:80%; border:1px solid #c5a059; border-radius:0;">
</div>
<p>The Vermilion Crane is the kind of establishment that does not need a sign — its reputation serves instead. Four stories of dark timber and white plaster, each room with its own receiving chamber and private bathing pool fed by a qi-heated spring. The lobby is marble and restraint. The innkeeper, a composed woman of forty with a cultivator's posture, receives you without looking at a ledger.</p>
<p><span class="female1">"Standard room, cultivation suite, or the crane suite?"</span> she asks. <span class="female1">"The crane suite is available. Given the current city situation, we've had some cancellations."</span> She names a nightly rate that explains the cancellations.</p>
<div class="choices" id="li-choices">
<<link "Take the standard room (30 stones/night)">>
<<replace "#li-choices">>
<p class="choice-taken">Take the standard room (30 stones/night)</p>
<p class="choice-taken">Take the cultivation suite (80 stones/night)</p>
<p class="choice-taken">Take the crane suite (200 stones/night)</p>
<p class="choice-taken">Just use the bathhouse (15 stones)</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#li-body">>
<<if $gold lt 30>>
<p>She mentions the rate. You mention your current situation diplomatically. She does not offer alternatives.</p>
<<else>>
<p>The standard room is still better than most places you've slept — clean tatami, a window facing the inner courtyard, a small receiving table and a brazier already lit. You sleep well. In the morning the complimentary breakfast includes actual good tea, which resolves any remaining ambivalence.</p>
<<startStatChanges>>
<<loseStat "PCgold" "PCgold" 30 0 999999 "Spirit Stones">>
<<showStatChanges>>
<</if>>
<</replace>>
<</link>>
<<link "Take the cultivation suite (80 stones/night)">>
<<replace "#li-choices">>
<p class="choice-taken">Take the standard room (30 stones/night)</p>
<p class="choice-taken">Take the cultivation suite (80 stones/night)</p>
<p class="choice-taken">Take the crane suite (200 stones/night)</p>
<p class="choice-taken">Just use the bathhouse (15 stones)</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#li-body">>
<<if $gold lt 80>>
<p>She names the rate and you count your stones. Not tonight.</p>
<<else>>
<p>The cultivation suite has qi-gathering arrays built into the floor and ceiling — subtle, steady, the kind that don't accelerate cultivation but maintain an optimal environment for it. The bathing pool is fed by a separate spring with trace mineral qi. You spend the night in the pool longer than intended and wake up with your meridians in better condition than they've been in weeks.</p>
<<startStatChanges>>
<<loseStat "PCgold" "PCgold" 80 0 999999 "Spirit Stones">>
<<gainStat "PCcultivationFame" "PCcultivationFame" 3 0 99999 "Cultivation Fame">>
<<showStatChanges>>
<</if>>
<</replace>>
<</link>>
<<link "Take the crane suite (200 stones/night)">>
<<replace "#li-choices">>
<p class="choice-taken">Take the standard room (30 stones/night)</p>
<p class="choice-taken">Take the cultivation suite (80 stones/night)</p>
<p class="choice-taken">Take the crane suite (200 stones/night)</p>
<p class="choice-taken">Just use the bathhouse (15 stones)</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#li-body">>
<<if $gold lt 200>>
<p>She names the rate. You do not name a response.</p>
<<else>>
<p>The crane suite occupies the entire fourth floor. The receiving chamber alone is larger than most cultivation halls you've trained in. The private spring pool sits in a garden enclosure open to the sky, qi-heated to precisely the temperature of a body at rest. The cultivation arrays are high-grade — the kind that cost more than the room itself.</p>
<p>You spend an unhurried twelve hours in the crane suite and leave feeling, for the first time in recent memory, adequately rested.</p>
<<startStatChanges>>
<<loseStat "PCgold" "PCgold" 200 0 999999 "Spirit Stones">>
<<gainStat "PCcultivationFame" "PCcultivationFame" 6 0 99999 "Cultivation Fame">>
<<gainStat "PCfame" "PCfame" 2 0 99999 "Fame">>
<<showStatChanges>>
<</if>>
<</replace>>
<</link>>
<<link "Just use the bathhouse (15 stones)">>
<<replace "#li-choices">>
<p class="choice-taken">Take the standard room (30 stones/night)</p>
<p class="choice-taken">Take the cultivation suite (80 stones/night)</p>
<p class="choice-taken">Take the crane suite (200 stones/night)</p>
<p class="choice-taken">Just use the bathhouse (15 stones)</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#li-body">>
<<if $gold lt 15>>
<p>Not tonight.</p>
<<else>>
<p>The inn's shared bathhouse is fed by the same spring as the suites. The water is extraordinary. You spend an hour in it and leave feeling clean in the specific way that good hot water and qi-enriched minerals produce — not cultivation progress, but the removal of accumulated noise.</p>
<<set _roll to random(1,100)>>
<<if _roll lte 25 and $sexFame gte 100>>
<p>You are not alone in the bathhouse — a noblewoman of perhaps thirty arrives a few minutes after you, and the attendant who should be separating the hours has apparently misread the schedule. She looks at you. You look at her. Neither of you calls for the attendant.</p>
<p>The hour in the bathhouse runs considerably longer than an hour. She leaves first, composure fully restored, and tells you her name as she goes. You file it under <em>useful</em>.</p>
/* === IMAGE: private bathhouse, hot spring, steam, noblewoman, Zyanbai, intimate proximity === */
<<startStatChanges>>
<<gainStat "PCsexFame" "PCsexFame" 2 0 99999 "Sex Fame">>
<<gainStat "PCfame" "PCfame" 1 0 99999 "Fame">>
<<showStatChanges>>
<<else>>
<<startStatChanges>>
<<showStatChanges>>
<</if>>
<<loseStat "PCgold" "PCgold" 15 0 999999 "Spirit Stones">>
<</if>>
<</replace>>
<</link>>
<<link "Leave">>
<<replace "#li-choices">>
<p class="choice-taken">Take the standard room (30 stones/night)</p>
<p class="choice-taken">Take the cultivation suite (80 stones/night)</p>
<p class="choice-taken">Take the crane suite (200 stones/night)</p>
<p class="choice-taken">Just use the bathhouse (15 stones)</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#li-body">>
<p>The lobby returns you to the Noble District street without ceremony.</p>
<</replace>>
<</link>>
</div>
<span id="li-body"></span>
<br><<link '<span class="nav-card exit-btn">← Noble Estates</span>' "Noble Estates">><</link>><div style="text-align:center;">
<h2 class="town-title">Phoenix City</h2> <div style="font-size: 0.9em; color: #c5a059; margin-top:-5px;">— Government District —</div>
<img src="images/Locations/Government District.jpg" class="location-bg" style="width:80%; border: 1px solid #c5a059; border-radius: 0;">
</div>
You step into a strictly ordered section of the city, where disciplined guards patrol stone pathways leading to grand administrative halls. Every building feels imposing and controlled, as officials manage laws, records, and the balance of power within the city.
<<link "Go back" $passage>><<set $pe to 0>><</link>>
<br>[[City Lord's Manor]]
<br>[[Law Enforcement Hall]]
<br>[[Treasury]]
<br>[[Prison]]
<br>[[Merit Hall]]<<set $PlayerLocation to passage()>>
<div style="text-align:center;">
<h2 class="town-title">City Lord's Manor</h2>
<div style="font-size:0.9em; color:#c5a059; margin-top:-5px;">— Government District —</div>
<img src="images/Locations/CityLordsManor.jpg" class="location-bg" style="width:80%; border:1px solid #c5a059; border-radius:0;">
</div>
<p>The City Lord's Manor occupies the Government District's highest ground — a compound of white stone and dark timber behind a wall marked with official seals at every gate. Two soldiers in formal armor stand at the main entrance. A steward in grey robes stands between them.</p>
<p>The manor is closed to general visitors. The gate seal — a smaller echo of the one on the city's outer wall — makes that unambiguous.</p>
<p>The steward steps forward. <span class="male2">"State your name and purpose."</span></p>
<div class="choices" id="clm-choices">
<<if $totalFame gte 1001>>
<<link "Present your credentials — request an audience">>
<<replace "#clm-choices">>
<p class="choice-taken">Present your credentials — request an audience</p>
<p class="choice-taken">Ask what it would take to gain entry</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#clm-body">>
<p>The steward takes your sect token, examines it, and disappears inside without comment. He returns after ten minutes.</p>
<p><span class="male2">"The City Lord is not receiving external cultivators while the seal holds. However, the Deputy Administrator will hear your matter. Follow me."</span></p>
<p>The Deputy Administrator is a compact woman who gives you fifteen minutes and three pieces of information she is technically not authorised to share, which she shares anyway with the air of someone making a calculated investment. You leave understanding the city's internal situation significantly better than when you arrived.</p>
<<startStatChanges>>
<<gainStat "PCfame" "PCfame" 5 0 99999 "Fame">>
<<gainStat "PCsectFame" "PCsectFame" 3 0 99999 "Sect Fame">>
<<showStatChanges>>
<</replace>>
<</link>>
<</if>>
<<link "Ask what it would take to gain entry">>
<<replace "#clm-choices">>
<<if $totalFame gte 1001>><p class="choice-taken">Present your credentials — request an audience</p><</if>>
<p class="choice-taken">Ask what it would take to gain entry</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#clm-body">>
<p>The steward looks at you with the practiced patience of a man who answers this question daily. <span class="male2">"An official matter requiring the City Lord's jurisdiction, a recommendation seal from a current government official, or a sect elder's introduction. In writing, stamped."</span> He pauses. <span class="male2">"Or notable service to the city, formally recognized."</span></p>
<p>He returns to his position. The conversation is complete from his perspective.</p>
<</replace>>
<</link>>
<<link "Leave">>
<<replace "#clm-choices">>
<<if $totalFame gte 1001>><p class="choice-taken">Present your credentials — request an audience</p><</if>>
<p class="choice-taken">Ask what it would take to gain entry</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#clm-body">>
<p>The gate seal and the steward watch you go with equal impassivity.</p>
<</replace>>
<</link>>
</div>
<span id="clm-body"></span>
<br><<link '<span class="nav-card exit-btn">← Government District</span>' "Government District">><</link>><<set $PlayerLocation to passage()>>
<div style="text-align:center;">
<h2 class="town-title">Law Enforcement Hall</h2>
<div style="font-size:0.9em; color:#c5a059; margin-top:-5px;">— Government District —</div>
<img src="images/Locations/LawEnforcementHall.jpg" class="location-bg" style="width:80%; border:1px solid #c5a059; border-radius:0;">
</div>
<p>The Law Enforcement Hall is the city's operational law — not policy, not judgment, but the part that puts hands on people. Its entrance is busy even with the city sealed: officers moving in and out, a queue of ordinary citizens with complaints, two cultivation-ranked enforcers in red and black standing at the inner door with the particular stillness of people who do not need to look threatening because they already are.</p>
<p>A duty officer at the front desk looks up when you approach. His evaluation of you takes about one second and lands somewhere between <em>cultivator</em> and <em>not a problem I want today.</em></p>
<div class="choices" id="leh-choices">
<<link "Report information about the city's situation">>
<<replace "#leh-choices">>
<p class="choice-taken">Report information about the city's situation</p>
<p class="choice-taken">Inquire about the city seal — what happened</p>
<p class="choice-taken">Check if there are active warrants relevant to you</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#leh-body">>
<<set _info to random(1,100)>>
<<if _info lte 50>>
<p>You share what you've gathered from the gate, the tea house, and the auction hall — collated, precise, more structured than what most walk-in informants provide. The duty officer listens with increasing attention and calls a superior by the third minute.</p>
<p>The superior is brief: the information is useful, a merit note will be filed. You are given a contact token for the enforcement hall's external informant channel.</p>
<<startStatChanges>>
<<gainStat "PCrighteousreputation" "PCrighteousreputation" 4 0 999 "Righteous Reputation">>
<<gainStat "PCfame" "PCfame" 2 0 99999 "Fame">>
<<showStatChanges>>
<<else>>
<p>You share what you know. The duty officer thanks you, writes something in a ledger, and returns to his work. The information may have been useful. You will never know.</p>
<<startStatChanges>>
<<gainStat "PCrighteousreputation" "PCrighteousreputation" 1 0 999 "Righteous Reputation">>
<<showStatChanges>>
<</if>>
<</replace>>
<</link>>
<<link "Inquire about the city seal — what happened">>
<<replace "#leh-choices">>
<p class="choice-taken">Report information about the city's situation</p>
<p class="choice-taken">Inquire about the city seal — what happened</p>
<p class="choice-taken">Check if there are active warrants relevant to you</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#leh-body">>
<p><span class="male2">"Active investigation. Not for public disclosure."</span> He says it without hostility. Standard.</p>
<<set _charm to random(1,100)>>
<<if $totalFame gte 551 and _charm lte 50>>
<p>He looks at you again — properly this time, registering your rank. Lowers his voice.</p>
<p><span class="male2">"A breach of the City Lord's archive two nights ago. Documents taken. High-level. That's all I can say."</span> He returns his eyes to the ledger. <span class="male2">"You didn't hear it from me."</span></p>
<<startStatChanges>>
<<gainStat "PCfame" "PCfame" 2 0 99999 "Fame">>
<<showStatChanges>>
<</if>>
<</replace>>
<</link>>
<<link "Check if there are active warrants relevant to you">>
<<replace "#leh-choices">>
<p class="choice-taken">Report information about the city's situation</p>
<p class="choice-taken">Inquire about the city seal — what happened</p>
<p class="choice-taken">Check if there are active warrants relevant to you</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#leh-body">>
<<if $demonicReputation gte 50>>
<p>The duty officer pulls a secondary ledger. He reads for a moment, then looks at you with new care. <span class="male2">"Nothing formal. Yet."</span> He marks something. <span class="male2">"You may want to watch your conduct in Phoenix City, <<print $CurrentPcSectRank>>."</span></p>
<<startStatChanges>>
<<gainStat "PCdemonicreputation" "PCdemonicreputation" 1 0 999 "Demonic Reputation">>
<<showStatChanges>>
<<else>>
<p>He checks. <span class="male2">"Nothing."</span> He closes the ledger. Clean record, at least as far as Phoenix City is concerned.</p>
<</if>>
<</replace>>
<</link>>
<<link "Leave">>
<<replace "#leh-choices">>
<p class="choice-taken">Report information about the city's situation</p>
<p class="choice-taken">Inquire about the city seal — what happened</p>
<p class="choice-taken">Check if there are active warrants relevant to you</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#leh-body">>
<p>The hall's noise swallows your departure.</p>
<</replace>>
<</link>>
</div>
<span id="leh-body"></span>
<br><<link '<span class="nav-card exit-btn">← Government District</span>' "Government District">><</link>><<set $PlayerLocation to passage()>>
<div style="text-align:center;">
<h2 class="town-title">City Treasury</h2>
<div style="font-size:0.9em; color:#c5a059; margin-top:-5px;">— Government District —</div>
<img src="images/Locations/Treasury.jpg" class="location-bg" style="width:80%; border:1px solid #c5a059; border-radius:0;">
</div>
<p>The Treasury building is modest from the outside by government district standards — no ornamentation, no announcement of its purpose. The entrance is protected by two formation arrays visible to anyone with cultivation sense and at least two more that aren't. A counter runs the width of the ground floor. Behind it, clerks in pale blue robes process paperwork with the focused efficiency of people who work with large numbers daily and have stopped being impressed by them.</p>
<p>The clerk who steps to your counter is young, precise, and completely uninterested in your cultivation rank.</p>
<div class="choices" id="tr-choices">
<<link "Convert spirit stones to official city currency">>
<<replace "#tr-choices">>
<p class="choice-taken">Convert spirit stones to official city currency</p>
<p class="choice-taken">Inquire about sect tax exemption status</p>
<p class="choice-taken">Ask about city bounty payment processing</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#tr-body">>
<p>The exchange rate today is standard. The clerk processes it without commentary. The city currency is more universally useful inside Phoenix City than spirit stones for non-cultivator transactions — merchants, inns, certain government services.</p>
<<startStatChanges>>
<<gainStat "PCgold" "PCgold" 10 0 999999 "Spirit Stones (converted)">>
<<showStatChanges>>
<p>The conversion is complete. You pocket the city notes.</p>
<</replace>>
<</link>>
<<link "Inquire about sect tax exemption status">>
<<replace "#tr-choices">>
<p class="choice-taken">Convert spirit stones to official city currency</p>
<p class="choice-taken">Inquire about sect tax exemption status</p>
<p class="choice-taken">Ask about city bounty payment processing</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#tr-body">>
<p>The clerk pulls a secondary ledger — thicker, older. <span class="male2">"Sect affiliation?"</span></p>
<p>You give it. He searches without visible judgment.</p>
<<if $sectFame gte 200>>
<p><span class="male2">"Your sect holds a current exemption on commerce taxes within city limits. Medical services, cultivation materials, and auction house purchases. Effective until the end of the fiscal year."</span> He stamps a small card and passes it across. <span class="male2">"Present this at relevant vendors."</span></p>
<<startStatChanges>>
<<gainStat "PCsectFame" "PCsectFame" 2 0 99999 "Sect Fame">>
<<showStatChanges>>
<<else>>
<p><span class="male2">"No current exemption on file for that sect."</span> He closes the ledger. <span class="male2">"Applications open on the first of the month. Standard form, sect elder's stamp required."</span></p>
<</if>>
<</replace>>
<</link>>
<<link "Ask about city bounty payment processing">>
<<replace "#tr-choices">>
<p class="choice-taken">Convert spirit stones to official city currency</p>
<p class="choice-taken">Inquire about sect tax exemption status</p>
<p class="choice-taken">Ask about city bounty payment processing</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#tr-body">>
<p><span class="male2">"Bounty claims go through the Law Enforcement Hall first. Once confirmed, the payment order comes here for processing within three working days."</span> He says this in the tone of someone who has said it several hundred times. <span class="male2">"Unless it's a City Lord's bounty, in which case it requires an additional counter-sign from the Deputy Administrator."</span></p>
<p>Useful to know.</p>
<</replace>>
<</link>>
<<link "Leave">>
<<replace "#tr-choices">>
<p class="choice-taken">Convert spirit stones to official city currency</p>
<p class="choice-taken">Inquire about sect tax exemption status</p>
<p class="choice-taken">Ask about city bounty payment processing</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#tr-body">>
<p>The formation arrays watch you leave with the impassive attention of things that don't have expressions.</p>
<</replace>>
<</link>>
</div>
<span id="tr-body"></span>
<br><<link '<span class="nav-card exit-btn">← Government District</span>' "Government District">><</link>><<set $PlayerLocation to passage()>>
<div style="text-align:center;">
<h2 class="town-title">Phoenix City Prison</h2>
<div style="font-size:0.9em; color:#c5a059; margin-top:-5px;">— Government District —</div>
<img src="images/Locations/Prison.jpg" class="location-bg" style="width:80%; border:1px solid #c5a059; border-radius:0;">
</div>
<p>The prison sits at the Government District's edge, bordered on one side by the Treasury and on the other by a narrow street that nobody uses if they don't have to. The entrance is a heavy iron gate set into stone, two guards in full enforcement livery, and a suppression array so dense you can feel it from ten paces — it dampens cultivation below a certain threshold, which is either a safety measure or a cruelty depending on who's inside.</p>
<p>An officer at the gate register looks up. <span class="male2">"Business?"</span></p>
<div class="choices" id="pr-choices">
<<link "Inquire about a specific prisoner">>
<<replace "#pr-choices">>
<p class="choice-taken">Inquire about a specific prisoner</p>
<p class="choice-taken">Request visitor access</p>
<p class="choice-taken">Examine the suppression arrays — cultivation observation</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#pr-body">>
<p><span class="player">"I'm looking for information on recent intakes."</span></p>
<p>He looks at you with the specific expression of a man who encounters this request in three forms: official, bribed, and delusional. He is trying to determine which category you fall into.</p>
<<if $totalFame gte 551>>
<p>He decides on <em>official enough.</em> <span class="male2">"Recent intakes — last forty-eight hours — are sealed due to the current investigation. I can confirm whether a name is in the system, nothing further."</span></p>
<p>You ask. He checks. He tells you nothing that matters but confirms that the current investigation has produced at least seven arrests, which is more than the Law Enforcement Hall disclosed.</p>
<<startStatChanges>>
<<gainStat "PCfame" "PCfame" 2 0 99999 "Fame">>
<<showStatChanges>>
<<else>>
<p>He decides on <em>not official enough.</em> <span class="male2">"Prisoner information is sealed. Try the Law Enforcement Hall with proper documentation."</span></p>
<</if>>
<</replace>>
<</link>>
<<link "Request visitor access">>
<<replace "#pr-choices">>
<p class="choice-taken">Inquire about a specific prisoner</p>
<p class="choice-taken">Request visitor access</p>
<p class="choice-taken">Examine the suppression arrays — cultivation observation</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#pr-body">>
<p><span class="male2">"Visitor access requires a signed authorization from the Law Enforcement Hall, the prisoner's name on the approved list, and visit hours are morning only."</span> He doesn't apologize for any of this. <span class="male2">"Next."</span></p>
<p>There is no next. He is simply indicating you are done.</p>
<</replace>>
<</link>>
<<link "Examine the suppression arrays — cultivation observation">>
<<replace "#pr-choices">>
<p class="choice-taken">Inquire about a specific prisoner</p>
<p class="choice-taken">Request visitor access</p>
<p class="choice-taken">Examine the suppression arrays — cultivation observation</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#pr-body">>
<<if $cultivationFame gte 200>>
<p>You study the arrays from outside the gate — close enough to read their structure without triggering a response. They are well-made: layered suppression with a passive alarm thread woven through the third layer that most cultivators wouldn't notice. The threshold is calibrated to Foundation Establishment. Anyone above that would feel significant resistance but not full suppression.</p>
<p>Useful to know, for various potential reasons.</p>
<<startStatChanges>>
<<gainStat "PCcultivationFame" "PCcultivationFame" 3 0 99999 "Cultivation Fame">>
<<showStatChanges>>
<<else>>
<p>The arrays are clearly present but their structure is above your current ability to parse cleanly. You catch the surface layer — standard suppression — and the sense of something more complex underneath that you can't quite read.</p>
<<startStatChanges>>
<<gainStat "PCcultivationFame" "PCcultivationFame" 1 0 99999 "Cultivation Fame">>
<<showStatChanges>>
<</if>>
<</replace>>
<</link>>
<<link "Leave">>
<<replace "#pr-choices">>
<p class="choice-taken">Inquire about a specific prisoner</p>
<p class="choice-taken">Request visitor access</p>
<p class="choice-taken">Examine the suppression arrays — cultivation observation</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#pr-body">>
<p>You walk away from the suppression array's edge and feel your cultivation return to its normal ambient state with the relief of something that didn't know it was being compressed until it wasn't.</p>
<</replace>>
<</link>>
</div>
<span id="pr-body"></span>
<br><<link '<span class="nav-card exit-btn">← Government District</span>' "Government District">><</link>><<set $PlayerLocation to passage()>>
<div style="text-align:center;">
<h2 class="town-title">Merit Hall</h2>
<div style="font-size:0.9em; color:#c5a059; margin-top:-5px;">— Government District —</div>
<img src="images/Locations/MeritHall.jpg" class="location-bg" style="width:80%; border:1px solid #c5a059; border-radius:0;">
</div>
<p>The Merit Hall is where Phoenix City keeps its official record of cultivator contributions — notable deeds, city-sanctioned missions, commendations from government officials, registered combat achievements within city jurisdiction. The record wall is public, carved into pale stone and updated by a Hall Keeper whose sole job is accuracy. A secondary counter handles merit registrations and inquiries.</p>
<p>You scan the wall. Several names are prominent. Yours is not among them — not yet.</p>
<div class="choices" id="mh-choices">
<<link "Register a recent deed for official merit">>
<<replace "#mh-choices">>
<p class="choice-taken">Register a recent deed for official merit</p>
<p class="choice-taken">Inquire about merit requirements for city privileges</p>
<p class="choice-taken">Study the record wall — learn who the notable figures are</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#mh-body">>
<<set _merit to random(1,100)>>
<<if _merit lte 40>>
<p>The Hall Keeper reviews what you describe. He asks three clarifying questions, each more specific than the last. At the end he stamps a provisional record — <em>unconfirmed, pending witness verification.</em> It goes on the wall in grey rather than black.</p>
<p><span class="male2">"If the witness confirms within ten days, it becomes permanent record."</span></p>
<<startStatChanges>>
<<gainStat "PCfame" "PCfame" 3 0 99999 "Fame">>
<<showStatChanges>>
<<else>>
<p>The Hall Keeper reviews your account. His expression is polite and entirely noncommittal throughout. At the end: <span class="male2">"Insufficient documentation for formal registration. A witness statement or official counter-sign is required."</span></p>
<p>He gives you the form anyway. <span class="male2">"In case the situation changes."</span></p>
<</if>>
<</replace>>
<</link>>
<<link "Inquire about merit requirements for city privileges">>
<<replace "#mh-choices">>
<p class="choice-taken">Register a recent deed for official merit</p>
<p class="choice-taken">Inquire about merit requirements for city privileges</p>
<p class="choice-taken">Study the record wall — learn who the notable figures are</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#mh-body">>
<p>He produces a printed card — clearly pre-prepared for this question — and recites while you read: merit threshold for city gate priority access is three registered deeds. For City Lord's Manor introduction, five deeds with at least one counter-signed by a government official. For formal city alliance status, ten deeds over two or more visits.</p>
<p>The numbers are achievable. Not quickly, but achievable.</p>
<</replace>>
<</link>>
<<link "Study the record wall — learn who the notable figures are">>
<<replace "#mh-choices">>
<p class="choice-taken">Register a recent deed for official merit</p>
<p class="choice-taken">Inquire about merit requirements for city privileges</p>
<p class="choice-taken">Study the record wall — learn who the notable figures are</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#mh-body">>
<p>Three names appear repeatedly — a combat cultivator named Wei Songfang, a healer named Bai Ruoyun, and a formation specialist with a name that has been partially obscured on two separate entries, which is interesting. You note the obscured name specifically.</p>
<p>The fourth name on the wall, added most recently, is a cultivator who apparently resolved a qi contamination event in the Common District six days ago. The entry is fresh enough that the stone carving still shows cutting dust at its base.</p>
<<startStatChanges>>
<<gainStat "PCfame" "PCfame" 1 0 99999 "Fame">>
<<showStatChanges>>
<</replace>>
<</link>>
<<link "Leave">>
<<replace "#mh-choices">>
<p class="choice-taken">Register a recent deed for official merit</p>
<p class="choice-taken">Inquire about merit requirements for city privileges</p>
<p class="choice-taken">Study the record wall — learn who the notable figures are</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#mh-body">>
<p>The record wall watches you leave with the permanent attention of stone.</p>
<</replace>>
<</link>>
</div>
<span id="mh-body"></span>
<br><<link '<span class="nav-card exit-btn">← Government District</span>' "Government District">><</link>><<set $PlayerLocation to passage()>>
<div style="text-align:center;">
<h2 class="town-title">Red Lantern District</h2>
<div style="font-size:0.9em; color:#c5a059; margin-top:-5px;">— Entertainment District —</div>
<img src="images/Locations/Entertainment District.jpg" class="location-bg" style="width:80%; border: 1px solid #c5a059; border-radius: 0;">
</div>
<br><<link "Go back" $passage>><<set $pe to 0>><</link>>
<p>The street breathes with red light and noise. Silk lanterns hang dense overhead, swaying in the warm evening air, their glow turning the cobblestones the colour of dying coals. The scent of incense and osmanthus wine drifts from every doorway. Music leaks from upper windows — erhu and percussion, laughter underneath it. Women lean on lacquered railings above, calling down to men who pretend not to look up.</p>
<p>You are immediately assessed by every pair of eyes on the street. The assessment varies — some see a cultivator, some see a woman alone, some see something else entirely.</p>
<<set _roll to random(1,100)>>
<<if _roll lte 25 and $sexFame gte 100>>
<p>A well-dressed man detaches from a group nearby and approaches with the easy confidence of someone who pays for that confidence regularly. His eyes settle on you with frank interest.</p>
<p><span class="male1">"I don't believe I've seen you here before. A cultivator, and that face —"</span> He smiles. <span class="male1">"I'd pay generously for your company tonight. Whatever terms you prefer."</span></p>
<div class="choices" id="rld-event-choices">
<<link "Name a price — entertain him">>
<<replace "#rld-event-choices">>
<p class="choice-taken">Name a price — entertain him</p>
<p class="choice-taken">Decline politely</p>
<p class="choice-taken">Decline with teeth</p>
<</replace>>
<<replace "#rld-event-body">>
<p>You name a figure. He doesn't flinch, which tells you the figure was too low. You file that away for next time.</p>
<p>His private room is well-appointed — heated wine, silk cushions, a view of the lantern street below. He is attentive and generous and, when it comes to it, exactly as skilled as a wealthy man who has been paying for company his whole life tends to be. You allow it. You have spent time less pleasantly.</p>
<p>He presses extra stones into your hand afterward with both of his, like a man trying to make an impression. <span class="male1">"Will you be here tomorrow?"</span></p>
<p><span class="player">"Perhaps."</span> You take the stones and leave him wondering.</p>
/* === IMAGE: private room, warm lantern light, wealthy merchant seated, Zyanbai composed and unhurried === */
<<startStatChanges>>
<<gainStat "PCgold" "PCgold" 50 0 999999 "Spirit Stones">>
<<gainStat "PCsexFame" "PCsexFame" 3 0 99999 "Sex Fame">>
<<showStatChanges>>
<</replace>>
<</link>>
<<link "Decline politely">>
<<replace "#rld-event-choices">>
<p class="choice-taken">Name a price — entertain him</p>
<p class="choice-taken">Decline politely</p>
<p class="choice-taken">Decline with teeth</p>
<</replace>>
<<replace "#rld-event-body">>
<p><span class="player">"I'm flattered. Not tonight."</span></p>
<p>He accepts it graciously — the mark of a man who is turned down regularly enough to have developed grace about it. He retreats with a small bow. The street resumes.</p>
<</replace>>
<</link>>
<<link "Decline with teeth">>
<<replace "#rld-event-choices">>
<p class="choice-taken">Name a price — entertain him</p>
<p class="choice-taken">Decline politely</p>
<p class="choice-taken">Decline with teeth</p>
<</replace>>
<<replace "#rld-event-body">>
<p>You look at him for a moment with the particular expression that makes people reconsider their life decisions. <span class="player">"Walk away,"</span> you say pleasantly.</p>
<p>He does. Quickly.</p>
<<startStatChanges>>
<<gainStat "PCdemonicreputation" "PCdemonicreputation" 1 0 999 "Demonic Reputation">>
<<showStatChanges>>
<</replace>>
<</link>>
</div>
<span id="rld-event-body"></span>
<</if>>
<div class="city-grid">
<br><<link '<span class="nav-card exit-btn">← Entertainment District</span>' "Entertainment District">><</link>>
<br><<link '<span class="nav-card">Courtesan House</span>' "Courtesan House">><</link>>
<<link '<span class="nav-card">Gambling Hall</span>' "Gambling Hall">><</link>>
<<link '<span class="nav-card">Music Pavilion</span>' "Music Pavilion">><</link>>
<<link '<span class="nav-card">Dance Pavilion</span>' "Dance Pavilion">><</link>>
<<link '<span class="nav-card">Theatre</span>' "Theatre">><</link>>
<<link '<span class="nav-card">High-class Brothel</span>' "High-class Brothel">><</link>>
<<link '<span class="nav-card">Underground Fight Club</span>' "Underground Fight Club">><</link>>
</div><<set $PlayerLocation to passage()>>
<div style="text-align:center;">
<h2 class="town-title">Courtesan House</h2>
<div style="font-size:0.9em; color:#c5a059; margin-top:-5px;">— Entertainment District —</div>
<img src="images/Locations/CourtesanHouse.jpg" class="location-bg" style="width:80%; border:1px solid #c5a059; border-radius:0;">
</div>
<p>The building is older than its neighbours and carries itself accordingly — three stories of dark timber and painted screens, each window glowing with soft amber light. A woman in layered silk stands at the entrance, her makeup precise, her smile practiced to the point of appearing genuine. She takes one look at you and steps aside without being asked.</p>
<p><span class="female1">"We don't often receive cultivators as guests rather than patrons,"</span> she says. <span class="female1">"Come in, honored one. Tea first, or shall I send someone to your room directly?"</span></p>
<div class="choices" id="ch-choices">
<<link "Take tea in the main hall — observe">>
<<replace "#ch-choices">>
<p class="choice-taken">Take tea in the main hall — observe</p>
<p class="choice-taken">Inquire about work</p>
<p class="choice-taken">Request a private room and company</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#ch-body">>
<p>The main hall is exactly what a cultivator watches for information: who sits with whom, who drinks too much, what names are dropped carelessly. By the time your tea is finished you have noted two merchant alliances, one marital infidelity of probable strategic significance, and a junior official who is spending well beyond his salary.</p>
<p>The courtesans are skilled at appearing not to notice you noticing. You respect the professionalism.</p>
<<startStatChanges>>
<<gainStat "PCfame" "PCfame" 2 0 99999 "Fame">>
<<showStatChanges>>
<</replace>>
<</link>>
<<link "Inquire about work">>
<<replace "#ch-choices">>
<p class="choice-taken">Take tea in the main hall — observe</p>
<p class="choice-taken">Inquire about work</p>
<p class="choice-taken">Request a private room and company</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#ch-body">>
<p>The madam's expression doesn't change, but something behind her eyes sharpens with interest. She leads you to a side room and closes the screen.</p>
<p><span class="female1">"A cultivator of your bearing would command the highest rate in this establishment. The clientele we host — sect elders, merchant lords, government officials — they pay for discretion and quality. Both of which you appear to possess."</span> She names a nightly figure that is, frankly, impressive. <span class="female1">"You would keep sixty percent. I handle the rest."</span></p>
<p>She gives you time to think about it.</p>
<div class="choices" id="ch-work-choices">
<<link "Accept the arrangement — take a client tonight">>
<<replace "#ch-work-choices">>
<p class="choice-taken">Accept the arrangement — take a client tonight</p>
<p class="choice-taken">Accept in principle — return another time</p>
<p class="choice-taken">Decline</p>
<</replace>>
<<replace "#ch-work-body">>
<p>She selects the client personally — a sect elder from out of city, silver-haired and careful in the way old cultivators are careful about everything. He does not rush. He is thorough and unhurried and treats the encounter with the same deliberate attention he likely gives to cultivation itself.</p>
<p>Afterward he presses stones into your hand and says, with complete sincerity: <span class="male1">"Remarkable. Truly remarkable."</span></p>
<p>You have no idea if he means you or himself.</p>
/* === IMAGE: private courtesan room, silk screens, candlelight, Zyanbai reclining, elder seated nearby === */
<<startStatChanges>>
<<gainStat "PCgold" "PCgold" 120 0 999999 "Spirit Stones">>
<<gainStat "PCsexFame" "PCsexFame" 5 0 99999 "Sex Fame">>
<<loseStat "PCrighteousreputation" "PCrighteousreputation" 2 0 999 "Righteous Reputation">>
<<showStatChanges>>
<</replace>>
<</link>>
<<link "Accept in principle — return another time">>
<<replace "#ch-work-choices">>
<p class="choice-taken">Accept the arrangement — take a client tonight</p>
<p class="choice-taken">Accept in principle — return another time</p>
<p class="choice-taken">Decline</p>
<</replace>>
<<replace "#ch-work-body">>
<p><span class="player">"I'll think on it."</span> You leave her your name — your real one, which impresses her more than anything else you've said.</p>
<p>She bows. <span class="female1">"The offer stands, honored one."</span></p>
<</replace>>
<</link>>
<<link "Decline">>
<<replace "#ch-work-choices">>
<p class="choice-taken">Accept the arrangement — take a client tonight</p>
<p class="choice-taken">Accept in principle — return another time</p>
<p class="choice-taken">Decline</p>
<</replace>>
<<replace "#ch-work-body">>
<p><span class="player">"Not what I'm looking for."</span></p>
<p>She nods, unsurprised. <span class="female1">"The offer remains open."</span></p>
<</replace>>
<</link>>
</div>
<span id="ch-work-body"></span>
<</replace>>
<</link>>
<<link "Request a private room and company">>
<<replace "#ch-choices">>
<p class="choice-taken">Take tea in the main hall — observe</p>
<p class="choice-taken">Inquire about work</p>
<p class="choice-taken">Request a private room and company</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#ch-body">>
<p>She sends you a young man — unusual for this establishment, she notes, but not impossible for the right guest. He is well-trained, quiet-spoken, and attentive in exactly the ways that matter.</p>
<p>The room is warm. The wine is good. You allow yourself an unhurried evening and feel no obligation to justify it to anyone.</p>
/* === IMAGE: private room, male courtesan kneeling attentively, Zyanbai at ease, warm silk surroundings === */
<<startStatChanges>>
<<loseStat "PCgold" "PCgold" 40 0 999999 "Spirit Stones">>
<<gainStat "PCsexFame" "PCsexFame" 2 0 99999 "Sex Fame">>
<<showStatChanges>>
<</replace>>
<</link>>
<<link "Leave">>
<<replace "#ch-choices">>
<p class="choice-taken">Take tea in the main hall — observe</p>
<p class="choice-taken">Inquire about work</p>
<p class="choice-taken">Request a private room and company</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#ch-body">>
<p>You step back into the lantern-lit street. The madam watches you go without expression.</p>
<</replace>>
<</link>>
</div>
<span id="ch-body"></span>
<br><<link '<span class="nav-card exit-btn">← Red Lantern District</span>' "Red Lantern District">><</link>><<set $PlayerLocation to passage()>>
<div style="text-align:center;">
<h2 class="town-title">Gambling Hall</h2>
<div style="font-size:0.9em; color:#c5a059; margin-top:-5px;">— Entertainment District —</div>
<img src="images/Locations/GamblingHall.jpg" class="location-bg" style="width:80%; border:1px solid #c5a059; border-radius:0;">
</div>
<p>Smoke and noise and the rattle of tiles. The hall runs long and low, lit by hanging oil lamps that turn everything amber. Tables of Dragon-Tiger, Heaven-Nine, and dice games are packed with men in various states of winning and losing, the two conditions distinguishable mainly by posture. A heavyset man in a red sash moves between tables — the house, visibly. Servers weave through with wine trays.</p>
<p>Nobody looks up when you enter. In a gambling hall, attention is a resource spent only on the table in front of you.</p>
<div class="choices" id="gh-choices">
<<link "Play Dragon-Tiger (wager 20 stones)">>
<<replace "#gh-choices">>
<p class="choice-taken">Play Dragon-Tiger (wager 20 stones)</p>
<p class="choice-taken">Play Heaven-Nine (wager 50 stones)</p>
<p class="choice-taken">Watch the room — look for cheats or opportunity</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#gh-body">>
<<set _win to random(1,100)>>
<<if $gold lt 20>>
<p>You reach for your stones and come up short. The dealer doesn't look at you — he has seen this before. You step back from the table.</p>
<<elseif _win lte 45>>
<p>The cards turn against you. Twenty stones lighter, you push back from the table with the particular stillness of someone who refuses to show it.</p>
<<startStatChanges>>
<<loseStat "PCgold" "PCgold" 20 0 999999 "Spirit Stones">>
<<showStatChanges>>
<<elseif _win lte 80>>
<p>You break even — your twenty returned, no more. The dealer sweeps the table with the same expression either way.</p>
<<else>>
<p>The cards fall well. Thirty stones profit — not enough to matter, but enough to enjoy.</p>
<<startStatChanges>>
<<gainStat "PCgold" "PCgold" 30 0 999999 "Spirit Stones">>
<<showStatChanges>>
<</if>>
<</replace>>
<</link>>
<<link "Play Heaven-Nine (wager 50 stones)">>
<<replace "#gh-choices">>
<p class="choice-taken">Play Dragon-Tiger (wager 20 stones)</p>
<p class="choice-taken">Play Heaven-Nine (wager 50 stones)</p>
<p class="choice-taken">Watch the room — look for cheats or opportunity</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#gh-body">>
<<set _win to random(1,100)>>
<<if $gold lt 50>>
<p>You count your stones. Not enough. The Heaven-Nine table has a minimum for a reason.</p>
<<elseif _win lte 40>>
<p>The tiles betray you completely. Fifty stones gone in three hands. The man across from you doesn't gloat — professionals never do.</p>
<<startStatChanges>>
<<loseStat "PCgold" "PCgold" 50 0 999999 "Spirit Stones">>
<<showStatChanges>>
<<elseif _win lte 70>>
<p>A narrow win. Twenty stones profit, earned the hard way across six slow hands.</p>
<<startStatChanges>>
<<gainStat "PCgold" "PCgold" 20 0 999999 "Spirit Stones">>
<<showStatChanges>>
<<else>>
<p>You read the table correctly from the second hand onward. A hundred stones profit. The man in the red sash begins watching your table with professional interest.</p>
<<startStatChanges>>
<<gainStat "PCgold" "PCgold" 100 0 999999 "Spirit Stones">>
<<gainStat "PCfame" "PCfame" 2 0 99999 "Fame">>
<<showStatChanges>>
<</if>>
<</replace>>
<</link>>
<<link "Watch the room — look for cheats or opportunity">>
<<replace "#gh-choices">>
<p class="choice-taken">Play Dragon-Tiger (wager 20 stones)</p>
<p class="choice-taken">Play Heaven-Nine (wager 50 stones)</p>
<p class="choice-taken">Watch the room — look for cheats or opportunity</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#gh-body">>
<<set _obs to random(1,100)>>
<<if _obs lte 40>>
<p>The hall is clean, or clean enough. The house takes its margin honestly. You watch for an hour and leave with nothing but an appreciation for how well-run a crooked business can look when it isn't crooked.</p>
<<elseif _obs lte 70>>
<p>Two tables over, a player is palming tiles with more confidence than skill. You watch him do it three times before he notices you watching. He cashes out immediately and leaves without making eye contact. Smart.</p>
<<startStatChanges>>
<<gainStat "PCfame" "PCfame" 1 0 99999 "Fame">>
<<showStatChanges>>
<<else>>
<p>The dealer at the far Heaven-Nine table is working with a player — subtle signals, barely readable. You approach the man in the red sash and tell him quietly. He listens without expression, thanks you with a small bag of stones, and is already walking toward the far table before you finish speaking.</p>
<<startStatChanges>>
<<gainStat "PCgold" "PCgold" 35 0 999999 "Spirit Stones">>
<<gainStat "PCrighteousreputation" "PCrighteousreputation" 2 0 999 "Righteous Reputation">>
<<showStatChanges>>
<</if>>
<</replace>>
<</link>>
<<link "Leave">>
<<replace "#gh-choices">>
<p class="choice-taken">Play Dragon-Tiger (wager 20 stones)</p>
<p class="choice-taken">Play Heaven-Nine (wager 50 stones)</p>
<p class="choice-taken">Watch the room — look for cheats or opportunity</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#gh-body">>
<p>The noise swallows you leaving the same way it swallowed you entering.</p>
<</replace>>
<</link>>
</div>
<span id="gh-body"></span>
<br><<link '<span class="nav-card exit-btn">← Red Lantern District</span>' "Red Lantern District">><</link>><<set $PlayerLocation to passage()>>
<div style="text-align:center;">
<h2 class="town-title">Music Pavilion</h2>
<div style="font-size:0.9em; color:#c5a059; margin-top:-5px;">— Entertainment District —</div>
<img src="images/Locations/MusicPavilion.jpg" class="location-bg" style="width:80%; border:1px solid #c5a059; border-radius:0;">
</div>
<p>A different kind of quiet than silence — the quiet of an audience holding its breath. The pavilion is open-sided, silk curtains tied back, and a woman plays guqin on the raised central platform with the absolute stillness of someone who has made peace with being watched. The notes carry further than they should. You suspect cultivation, refined into something that isn't combat and isn't healing but is its own category of discipline entirely.</p>
<p>Cushioned seats are arranged in concentric arcs. Most are occupied. A server materialises at your elbow with a tray of chilled plum wine.</p>
<<set _roll to random(1,100)>>
<<if _roll lte 20 and $sexFame gte 100>>
<p>The man in the seat beside yours leans over during the pause between pieces. He is well-dressed, middle-aged, with the hands of someone who works with documents rather than weapons. <span class="male1">"You look like someone who appreciates more than the music,"</span> he says quietly. He lets the implication sit.</p>
<div class="choices" id="mp-event-choices">
<<link "Entertain the implication">>
<<replace "#mp-event-choices">>
<p class="choice-taken">Entertain the implication</p>
<p class="choice-taken">Ignore him — listen to the music</p>
<</replace>>
<<replace "#mp-event-body">>
<p>You let your eyes stay on the stage and say nothing for long enough that he begins to wonder if he misjudged you entirely. Then: <span class="player">"My room or yours?"</span></p>
<p>His is closer. It is also very well appointed, which tells you something about his salary. The evening that follows is quieter than the gambling hall and considerably more satisfying than most of what passes for entertainment in this district. He is attentive — the document-handling hands turn out to be an asset — and discreet, and doesn't ask your name until afterward, which you find correct.</p>
/* === IMAGE: private room adjacent to pavilion, warm lamplight, refined civilian, Zyanbai unhurried and in control of the pace === */
<<startStatChanges>>
<<gainStat "PCgold" "PCgold" 30 0 999999 "Spirit Stones">>
<<gainStat "PCsexFame" "PCsexFame" 2 0 99999 "Sex Fame">>
<<showStatChanges>>
<</replace>>
<</link>>
<<link "Ignore him — listen to the music">>
<<replace "#mp-event-choices">>
<p class="choice-taken">Entertain the implication</p>
<p class="choice-taken">Ignore him — listen to the music</p>
<</replace>>
<<replace "#mp-event-body">>
<p>You turn your attention back to the stage with a finality that communicates itself without words. He shifts in his seat and doesn't try again. The guqin continues.</p>
<</replace>>
<</link>>
</div>
<span id="mp-event-body"></span>
<</if>>
<div class="choices" id="mp-choices">
<<link "Stay for the full performance">>
<<replace "#mp-choices">>
<p class="choice-taken">Stay for the full performance</p>
<p class="choice-taken">Speak with the musician after</p>
<p class="choice-taken">Leave early</p>
<</replace>>
<<replace "#mp-body">>
<p>You stay until the last note fades and the audience exhales together. The musician bows once — precise, unhurried — and the curtains draw. You leave feeling like something in you has been briefly and accurately tuned.</p>
<<startStatChanges>>
<<gainStat "PCcultivationFame" "PCcultivationFame" 1 0 99999 "Cultivation Fame">>
<<showStatChanges>>
<</replace>>
<</link>>
<<link "Speak with the musician after">>
<<replace "#mp-choices">>
<p class="choice-taken">Stay for the full performance</p>
<p class="choice-taken">Speak with the musician after</p>
<p class="choice-taken">Leave early</p>
<</replace>>
<<replace "#mp-body">>
<p>She receives you without surprise in the small room behind the stage. Up close she is older than she appeared on the platform, and the stillness is not performance — it is simply how she is.</p>
<p><span class="female1">"A cultivator,"</span> she says, not as a question. <span class="female1">"You felt the resonance in the fifth piece."</span></p>
<p><span class="player">"I did."</span></p>
<p>She nods slowly. <span class="female1">"Come back when the city opens. I have things I teach only to those who can hear them."</span></p>
<p>You file her away under people worth knowing.</p>
<<startStatChanges>>
<<gainStat "PCcultivationFame" "PCcultivationFame" 3 0 99999 "Cultivation Fame">>
<<showStatChanges>>
<</replace>>
<</link>>
<<link "Leave early">>
<<replace "#mp-choices">>
<p class="choice-taken">Stay for the full performance</p>
<p class="choice-taken">Speak with the musician after</p>
<p class="choice-taken">Leave early</p>
<</replace>>
<<replace "#mp-body">>
<p>You slip out between movements. The night air is cooler than the pavilion and carries less weight.</p>
<</replace>>
<</link>>
</div>
<span id="mp-body"></span>
<br><<link '<span class="nav-card exit-btn">← Red Lantern District</span>' "Red Lantern District">><</link>><<set $PlayerLocation to passage()>>
<div style="text-align:center;">
<h2 class="town-title">Dance Pavilion</h2>
<div style="font-size:0.9em; color:#c5a059; margin-top:-5px;">— Entertainment District —</div>
<img src="images/Locations/DancePavilion.jpg" class="location-bg" style="width:80%; border:1px solid #c5a059; border-radius:0;">
</div>
<p>The Dance Pavilion is louder and warmer than the Music Pavilion — silk sleeves and percussion, the stamp of feet on lacquered wood. Three dancers move through a sword-dance interpretation that blurs the line between performance and martial form. The audience is younger here, more wine, more noise, more people watching each other as much as the stage.</p>
<p>A hostess in layered crimson guides you to a seat near the front with more attention than the space warrants. You notice other cultivators in the audience — rare enough to mean something.</p>
<<set _roll to random(1,100)>>
<<if _roll lte 30>>
<p>During the interval, a young dancer approaches your table directly — off-schedule, clearly her own initiative. She is still flushed from the performance, her hair slightly undone. She looks at you with the directness of someone who has decided something and is acting on it.</p>
<p><span class="female1">"You move like you've studied forms,"</span> she says. <span class="female1">"I'd like to show you ours. Privately."</span></p>
<div class="choices" id="dp-event-choices">
<<link "Accept her invitation">>
<<replace "#dp-event-choices">>
<p class="choice-taken">Accept her invitation</p>
<p class="choice-taken">Decline — watch the second half instead</p>
<</replace>>
<<replace "#dp-event-body">>
<p>The room she leads you to backstage is small and warm and smells of sweat and perfume in a ratio that is not unpleasant. She shows you forms, technically speaking — then abandons the pretense with a directness you find refreshing. She knows what she wants and takes it with the same physical confidence she brings to the stage.</p>
<p>Afterward she ties her hair back up and returns to the stage for the second half without comment. You watch the rest of the performance with a different appreciation for her stamina.</p>
/* === IMAGE: small backstage room, dancer's costume partially loosened, warm candlelight, Zyanbai present and engaged === */
<<startStatChanges>>
<<gainStat "PCsexFame" "PCsexFame" 2 0 99999 "Sex Fame">>
<<showStatChanges>>
<</replace>>
<</link>>
<<link "Decline — watch the second half instead">>
<<replace "#dp-event-choices">>
<p class="choice-taken">Accept her invitation</p>
<p class="choice-taken">Decline — watch the second half instead</p>
<</replace>>
<<replace "#dp-event-body">>
<p>You smile and shake your head. She takes it without offense — a woman who makes offers expecting to sometimes be declined — and returns to the stage with the same easy confidence she arrived with.</p>
<p>The second half is better than the first.</p>
<</replace>>
<</link>>
</div>
<span id="dp-event-body"></span>
<</if>>
<div class="choices" id="dp-choices">
<<link "Watch the full performance">>
<<replace "#dp-choices">>
<p class="choice-taken">Watch the full performance</p>
<p class="choice-taken">Ask to participate — demonstrate your own forms</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#dp-body">>
<p>The sword-dance ends in a tableau that holds for three full breaths before the dancers break it. The applause is genuine. You find yourself included in it.</p>
<</replace>>
<</link>>
<<link "Ask to participate — demonstrate your own forms">>
<<replace "#dp-choices">>
<p class="choice-taken">Watch the full performance</p>
<p class="choice-taken">Ask to participate — demonstrate your own forms</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#dp-body">>
<<set _perf to random(1,100)>>
<<if _perf lte 30>>
<p>The pavilion master accepts your offer with polite skepticism. On the stage, the skepticism does not survive the first form. By the third you have lost the audience's interest in the original performers entirely. The applause runs long.</p>
<<startStatChanges>>
<<gainStat "PCcombatFame" "PCcombatFame" 5 0 99999 "Combat Fame">>
<<gainStat "PCfame" "PCfame" 3 0 99999 "Fame">>
<<showStatChanges>>
<<else>>
<p>The pavilion master politely declines — the program is set. He offers you a complimentary return ticket and manages to make it feel like a reasonable exchange. You pocket the ticket and sit back down.</p>
<</if>>
<</replace>>
<</link>>
<<link "Leave">>
<<replace "#dp-choices">>
<p class="choice-taken">Watch the full performance</p>
<p class="choice-taken">Ask to participate — demonstrate your own forms</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#dp-body">>
<p>The percussion follows you out into the street and fades slowly.</p>
<</replace>>
<</link>>
</div>
<span id="dp-body"></span>
<br><<link '<span class="nav-card exit-btn">← Red Lantern District</span>' "Red Lantern District">><</link>><<set $PlayerLocation to passage()>>
<div style="text-align:center;">
<h2 class="town-title">Theatre</h2>
<div style="font-size:0.9em; color:#c5a059; margin-top:-5px;">— Entertainment District —</div>
<img src="images/Locations/Theatre.jpg" class="location-bg" style="width:80%; border:1px solid #c5a059; border-radius:0;">
</div>
<p>The billboard outside announces a three-act opera: <em>The Crimson Demon of Luoshan</em>. The lead role is a female cultivator who destroys three sects and ascends anyway. You buy a ticket without deliberating.</p>
<p>Inside, the theatre is full — lacquered boxes for the wealthy along the upper tier, standing room packed below. The stage is magnificent: painted backdrops, cultivator-lit special effects, a lead actress whose voice carries genuine qi resonance. The crowd is vocal and engaged in the way Phoenix City crowds always are — opinions shouted freely, snacks consumed loudly.</p>
<<set _roll to random(1,100)>>
<<if _roll lte 20 and $totalFame gte 551>>
<p>During the second act's interval, a murmur moves through the box tier. Someone has recognized you. By the time the third act begins, three different attendants have delivered complimentary wine to your seat from anonymous admirers in the boxes above.</p>
<<startStatChanges>>
<<gainStat "PCfame" "PCfame" 3 0 99999 "Fame">>
<<showStatChanges>>
<</if>>
<div class="choices" id="th-choices">
<<link "Watch all three acts">>
<<replace "#th-choices">>
<p class="choice-taken">Watch all three acts</p>
<p class="choice-taken">Leave after the first act</p>
<p class="choice-taken">Seek out the lead actress backstage</p>
<</replace>>
<<replace "#th-body">>
<p>The Crimson Demon ascends in the final scene amid cultivation-light and percussion. The crowd stands. You find yourself standing with them, which you note with mild surprise.</p>
<p>The walk back through the lantern district afterward feels different. It takes you a moment to identify the feeling as something adjacent to inspiration, which you decide not to examine too closely.</p>
<<startStatChanges>>
<<gainStat "PCcultivationFame" "PCcultivationFame" 2 0 99999 "Cultivation Fame">>
<<showStatChanges>>
<</replace>>
<</link>>
<<link "Leave after the first act">>
<<replace "#th-choices">>
<p class="choice-taken">Watch all three acts</p>
<p class="choice-taken">Leave after the first act</p>
<p class="choice-taken">Seek out the lead actress backstage</p>
<</replace>>
<<replace "#th-body">>
<p>The first act is strong. You don't need three to know what kind of story it is. You leave at the interval with the good part intact and the ending still hypothetical.</p>
<</replace>>
<</link>>
<<link "Seek out the lead actress backstage">>
<<replace "#th-choices">>
<p class="choice-taken">Watch all three acts</p>
<p class="choice-taken">Leave after the first act</p>
<p class="choice-taken">Seek out the lead actress backstage</p>
<</replace>>
<<replace "#th-body">>
<p>The stage manager tries to stop you. You explain, without raising your voice, that you are a cultivator of <<print $CurrentPcSectRank>> rank and that you would like five minutes. He steps aside.</p>
<p>The lead actress is still in full costume and makeup, seated at a mirror and removing stage rouge with the focused efficiency of someone with two more performances this week. She looks at your reflection.</p>
<p><span class="female1">"The Crimson Demon has a visitor."</span> She sounds amused. <span class="female1">"What did you think of the third act?"</span></p>
<p><span class="player">"I didn't wait for it. I wanted to meet the real version."</span></p>
<p>She turns around on her stool and looks at you properly for the first time. <span class="female1">"Careful,"</span> she says. <span class="female1">"I might take that as a challenge."</span></p>
<p>You leave an hour later with a standing invitation to the private box, her personal seal on a paper card, and a very thorough understanding of what stage actresses do with their evenings after the curtain falls.</p>
/* === IMAGE: actress's dressing room, ornate costume half-removed, warm mirror-light, Zyanbai present, charged atmosphere === */
<<startStatChanges>>
<<gainStat "PCsexFame" "PCsexFame" 3 0 99999 "Sex Fame">>
<<gainStat "PCfame" "PCfame" 2 0 99999 "Fame">>
<<showStatChanges>>
<</replace>>
<</link>>
</div>
<span id="th-body"></span>
<br><<link '<span class="nav-card exit-btn">← Red Lantern District</span>' "Red Lantern District">><</link>><<set $PlayerLocation to passage()>>
<div style="text-align:center;">
<h2 class="town-title">The Jade Blossom</h2>
<div style="font-size:0.9em; color:#c5a059; margin-top:-5px;">— Entertainment District —</div>
<img src="images/Locations/JadeBlossom.jpg" class="location-bg" style="width:80%; border:1px solid #c5a059; border-radius:0;">
</div>
<p>The Jade Blossom does not advertise. Its door is unmarked lacquered wood on a quiet corner of the lantern district, and you only know it by the jade pendant above the lintel — a private signal for those who need no other. The door opens before you knock.</p>
<p>Inside: deep carpet, low music, the scent of rare incense rather than cheap perfume. A woman of indeterminate age in understated silk appraises you with the efficiency of long practice and the courtesy of a professional who has seen everything.</p>
<p><span class="female1">"Cultivator. First visit."</span> Not questions. <span class="female1">"Are you here as a guest or inquiring about a position?"</span></p>
<div class="choices" id="hcb-choices">
<<link "Guest — select from the house">>
<<replace "#hcb-choices">>
<p class="choice-taken">Guest — select from the house</p>
<p class="choice-taken">Inquire about a position here</p>
<p class="choice-taken">Ask about the clientele</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#hcb-body">>
<<set _companion to random(1,3)>>
<<if $gold lt 80>>
<p>She names the minimum. You count your stones and come up short. She does not comment — this too she has seen before. You leave.</p>
<<elseif _companion is 1>>
<p>She presents three choices with brief, precise descriptions. You select the second — a man trained in both conversation and everything else, with the quiet manner of someone who has never needed to perform either.</p>
<p>The room is as well-appointed as the entrance suggested. He is skilled, unhurried, and genuinely attentive — the last quality being the rarest and most expensive. You spend the better part of the evening in ways that feel, unusually, like rest.</p>
/* === IMAGE: Jade Blossom private room, silk and candlelight, male companion, Zyanbai reclining and content === */
<<startStatChanges>>
<<loseStat "PCgold" "PCgold" 80 0 999999 "Spirit Stones">>
<<gainStat "PCsexFame" "PCsexFame" 2 0 99999 "Sex Fame">>
<<showStatChanges>>
<<elseif _companion is 2>>
<p>She presents three choices. You select the first — a woman whose file, the madam explains, includes dual cultivation experience with three different sect affiliations. The claim proves accurate. The evening is educational in ways cultivation manuals omit.</p>
/* === IMAGE: Jade Blossom private room, female companion in partial undress, warm light, Zyanbai at ease === */
<<startStatChanges>>
<<loseStat "PCgold" "PCgold" 80 0 999999 "Spirit Stones">>
<<gainStat "PCsexFame" "PCsexFame" 2 0 99999 "Sex Fame">>
<<gainStat "PCcultivationFame" "PCcultivationFame" 1 0 99999 "Cultivation Fame">>
<<showStatChanges>>
<<else>>
<p>She presents the third option — a pair, she explains, who specialize in guests who prefer not to choose. She is correct that you prefer not to choose. What follows is thorough, coordinated, and leaves you in a state of genuine physical satisfaction that you decline to analyze further.</p>
/* === IMAGE: Jade Blossom private room, two companions, warm candlelight, Zyanbai between them, all three relaxed === */
<<startStatChanges>>
<<loseStat "PCgold" "PCgold" 150 0 999999 "Spirit Stones">>
<<gainStat "PCsexFame" "PCsexFame" 4 0 99999 "Sex Fame">>
<<showStatChanges>>
<</if>>
<</replace>>
<</link>>
<<link "Inquire about a position here">>
<<replace "#hcb-choices">>
<p class="choice-taken">Guest — select from the house</p>
<p class="choice-taken">Inquire about a position here</p>
<p class="choice-taken">Ask about the clientele</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#hcb-body">>
<p>Something in her expression shifts — not surprise, but recalibration. <span class="female1">"We don't recruit often. The Jade Blossom's standard is not easily met."</span></p>
<p>She looks at you for a long moment.</p>
<p><span class="female1">"A cultivator of genuine rank, however, would be a category unto herself. Our most discerning clients — sect elders, City Lord's officials, visiting dignitaries — pay for experiences they cannot find elsewhere."</span> She names a figure per engagement. It is, by any measure, extraordinary. <span class="female1">"You would set your own terms for which clients you accept. I take twenty percent."</span></p>
<div class="choices" id="hcb-work-choices">
<<link "Accept — take a client tonight">>
<<replace "#hcb-work-choices">>
<p class="choice-taken">Accept — take a client tonight</p>
<p class="choice-taken">Accept in principle — return when the city opens</p>
<p class="choice-taken">Decline</p>
<</replace>>
<<replace "#hcb-work-body">>
<p>She selects from a short waiting list — a visiting merchant prince from the southern territories who has been requesting a cultivator specifically for three visits running. He is wealthy enough to be relaxed about it and experienced enough not to waste either of your time.</p>
<p>The room is the best in the house. So, you will learn, is he.</p>
<p>The madam presses a silk envelope into your hand as you leave. The weight of it is satisfying.</p>
/* === IMAGE: Jade Blossom finest suite, wealthy southern merchant, Zyanbai composed and in control of the arrangement === */
<<startStatChanges>>
<<gainStat "PCgold" "PCgold" 200 0 999999 "Spirit Stones">>
<<gainStat "PCsexFame" "PCsexFame" 6 0 99999 "Sex Fame">>
<<loseStat "PCrighteousreputation" "PCrighteousreputation" 3 0 999 "Righteous Reputation">>
<<showStatChanges>>
<</replace>>
<</link>>
<<link "Accept in principle — return when the city opens">>
<<replace "#hcb-work-choices">>
<p class="choice-taken">Accept — take a client tonight</p>
<p class="choice-taken">Accept in principle — return when the city opens</p>
<p class="choice-taken">Decline</p>
<</replace>>
<<replace "#hcb-work-body">>
<p>She gives you a jade token — small, carved, warm in the hand. <span class="female1">"Present this at the door. You'll be expected."</span></p>
<p>You pocket it. The weight is light but the implication is not.</p>
<</replace>>
<</link>>
<<link "Decline">>
<<replace "#hcb-work-choices">>
<p class="choice-taken">Accept — take a client tonight</p>
<p class="choice-taken">Accept in principle — return when the city opens</p>
<p class="choice-taken">Decline</p>
<</replace>>
<<replace "#hcb-work-body">>
<p><span class="player">"Not what I need right now."</span></p>
<p>She nods once. <span class="female1">"The offer doesn't expire."</span></p>
<</replace>>
<</link>>
</div>
<span id="hcb-work-body"></span>
<</replace>>
<</link>>
<<link "Ask about the clientele">>
<<replace "#hcb-choices">>
<p class="choice-taken">Guest — select from the house</p>
<p class="choice-taken">Inquire about a position here</p>
<p class="choice-taken">Ask about the clientele</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#hcb-body">>
<p>She smiles — the first genuine one. <span class="female1">"Discretion is the house's primary product. I don't discuss clients."</span></p>
<p>A pause. <span class="female1">"I will say that the City Lord's household maintains a standing account. And that three of the seven sect elders currently residing in Phoenix City have visited within the last month."</span></p>
<p>She says nothing else. She doesn't need to.</p>
<<startStatChanges>>
<<gainStat "PCfame" "PCfame" 1 0 99999 "Fame">>
<<showStatChanges>>
<</replace>>
<</link>>
<<link "Leave">>
<<replace "#hcb-choices">>
<p class="choice-taken">Guest — select from the house</p>
<p class="choice-taken">Inquire about a position here</p>
<p class="choice-taken">Ask about the clientele</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#hcb-body">>
<p>You step back into the unmarked street. The jade pendant above the lintel catches the lantern light as you go.</p>
<</replace>>
<</link>>
</div>
<span id="hcb-body"></span>
<br><<link '<span class="nav-card exit-btn">← Red Lantern District</span>' "Red Lantern District">><</link>><<set $PlayerLocation to passage()>>
<div style="text-align:center;">
<h2 class="town-title">The Pit</h2>
<div style="font-size:0.9em; color:#c5a059; margin-top:-5px;">— Entertainment District —</div>
<img src="images/Locations/UndergroundFightClub.jpg" class="location-bg" style="width:80%; border:1px solid #c5a059; border-radius:0;">
</div>
<p>The entrance is a trapdoor behind a noodle stall whose owner pretends not to know it exists. Below: a circular pit ringed by tiered standing areas packed with bodies, the noise enormous, the lighting provided by cultivation-torches that burn without smoke. Two fighters circle each other in the pit below — no weapons, no sect affiliation markers, no rules visible from where you stand.</p>
<p>A wiry woman with a ledger and a shaved head materializes at your elbow. <span class="female1">"Spectating or entering?"</span> she says. <span class="female1">"Spectating is free. Entering starts at fifty."</span></p>
<<set _roll to random(1,100)>>
<<if _roll lte 25 and $sexFame gte 100>>
<p>A man beside you has been watching you rather than the pit since you arrived. He leans over. <span class="male1">"I'll put two hundred on you if you fight. Split the winnings."</span> He pauses. <span class="male1">"And if you win, I have a private celebration in mind."</span></p>
<div class="choices" id="ufc-event-choices">
<<link "Take his bet — enter the pit">>
<<replace "#ufc-event-choices">>
<p class="choice-taken">Take his bet — enter the pit</p>
<p class="choice-taken">Decline his offer</p>
<</replace>>
<<replace "#ufc-event-body">>
<<set _fight to random(1,100)>>
<<if _fight lte 70>>
<p>You win. It isn't close after the first exchange — your opponent is strong but untrained, and training is exactly the gap that matters when both fighters are pushing qi past normal limits. The crowd is extremely loud about it.</p>
<p>The man finds you at the edge of the pit with the split winnings and a grin that hasn't left his face since the third blow. The private celebration takes place in a rented room two streets over and is, like the fight, more thorough than your opponent expected and precisely as long as you choose to make it.</p>
/* === IMAGE: rented room, fight-flushed atmosphere, man clearly delighted and slightly overwhelmed, Zyanbai composed === */
<<startStatChanges>>
<<gainStat "PCgold" "PCgold" 150 0 999999 "Spirit Stones">>
<<gainStat "PCcombatFame" "PCcombatFame" 8 0 99999 "Combat Fame">>
<<gainStat "PCsexFame" "PCsexFame" 3 0 99999 "Sex Fame">>
<<showStatChanges>>
<<else>>
<p>Your opponent catches you with something you didn't read in time. You lose the match — not badly, but definitively. The man who made the offer is philosophical about the stones and considerably less interested in the celebration. You leave the pit sore and lighter in the pocket.</p>
<<startStatChanges>>
<<loseStat "PCgold" "PCgold" 50 0 999999 "Spirit Stones">>
<<gainStat "PCcombatFame" "PCcombatFame" 2 0 99999 "Combat Fame">>
<<showStatChanges>>
<</if>>
<</replace>>
<</link>>
<<link "Decline his offer">>
<<replace "#ufc-event-choices">>
<p class="choice-taken">Take his bet — enter the pit</p>
<p class="choice-taken">Decline his offer</p>
<</replace>>
<<replace "#ufc-event-body">>
<p>You look at him without expression until he turns back to the fight. He does it quickly.</p>
<</replace>>
<</link>>
</div>
<span id="ufc-event-body"></span>
<</if>>
<div class="choices" id="ufc-choices">
<<link "Enter the pit (wager 50 stones)">>
<<replace "#ufc-choices">>
<p class="choice-taken">Enter the pit (wager 50 stones)</p>
<p class="choice-taken">Spectate and bet on a fighter</p>
<p class="choice-taken">Watch without betting</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#ufc-body">>
<<if $gold lt 50>>
<p>You reach for your stones. Short. The ledger woman shakes her head without looking up.</p>
<<else>>
<<set _fight to random(1,100)>>
<<if _fight lte 60>>
<p>You win your match and the one after it. By the third bout the crowd knows your name — or is making one up for you, which amounts to the same thing. The ledger woman pays out with the expression of someone recalculating the evening's margins.</p>
<<startStatChanges>>
<<gainStat "PCgold" "PCgold" 120 0 999999 "Spirit Stones">>
<<gainStat "PCcombatFame" "PCcombatFame" 10 0 99999 "Combat Fame">>
<<gainStat "PCfame" "PCfame" 3 0 99999 "Fame">>
<<showStatChanges>>
<<else>>
<p>You win the first bout cleanly. The second puts you down in a way that will bruise interestingly by morning. You collect what's left of your stake and exit the pit with your dignity and not much else.</p>
<<startStatChanges>>
<<loseStat "PCgold" "PCgold" 30 0 999999 "Spirit Stones">>
<<gainStat "PCcombatFame" "PCcombatFame" 4 0 99999 "Combat Fame">>
<<showStatChanges>>
<</if>>
<</if>>
<</replace>>
<</link>>
<<link "Spectate and bet on a fighter">>
<<replace "#ufc-choices">>
<p class="choice-taken">Enter the pit (wager 50 stones)</p>
<p class="choice-taken">Spectate and bet on a fighter</p>
<p class="choice-taken">Watch without betting</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#ufc-body">>
<<set _bet to random(1,100)>>
<<if _bet lte 50>>
<p>Your read on the fighters is correct — the shorter one moves better and wins by the third exchange. Thirty stones profit.</p>
<<startStatChanges>>
<<gainStat "PCgold" "PCgold" 30 0 999999 "Spirit Stones">>
<<showStatChanges>>
<<else>>
<p>Your fighter goes down in the second exchange. Twenty stones gone. The crowd doesn't care.</p>
<<startStatChanges>>
<<loseStat "PCgold" "PCgold" 20 0 999999 "Spirit Stones">>
<<showStatChanges>>
<</if>>
<</replace>>
<</link>>
<<link "Watch without betting">>
<<replace "#ufc-choices">>
<p class="choice-taken">Enter the pit (wager 50 stones)</p>
<p class="choice-taken">Spectate and bet on a fighter</p>
<p class="choice-taken">Watch without betting</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#ufc-body">>
<p>You watch three bouts with the professional attention of someone studying technique rather than gambling on it. Two of the fighters are better than this venue deserves. You file them away.</p>
<<startStatChanges>>
<<gainStat "PCcombatFame" "PCcombatFame" 1 0 99999 "Combat Fame">>
<<showStatChanges>>
<</replace>>
<</link>>
<<link "Leave">>
<<replace "#ufc-choices">>
<p class="choice-taken">Enter the pit (wager 50 stones)</p>
<p class="choice-taken">Spectate and bet on a fighter</p>
<p class="choice-taken">Watch without betting</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#ufc-body">>
<p>You climb back through the trapdoor. The noodle stall owner does not look at you.</p>
<</replace>>
<</link>>
</div>
<span id="ufc-body"></span>
<br><<link '<span class="nav-card exit-btn">← Red Lantern District</span>' "Red Lantern District">><</link>><div class="council-hall-container">
<<if $pe eq 0>>
<!-- MAIN RANK PROGRESSION SCREEN -->
<div class="council-header">
<h2>🏯 Council of Elders</h2>
<p class="council-subtitle">The inner sanctum where ranks are recognized and destiny unfolds</p>
</div>
<div class="rank-display">
<div class="rank-badge">
<span class="rank-current">Current Rank</span>
<span class="rank-title"><<print $CurrentPcSectRank>></span>
<span class="sect-name"><<print $CurrentPcAffiliation>></span>
</div>
</div>
<div class="rank-requirements">
<<set _nextRank to "">>
<<set _canPromote to false>>
<<if $CurrentPcSectRank == "Initiate">>
<<set _nextRank to "Disciple">>
<<set _canPromote to $ContributionPoints >= 50 and $CurrentPcSectReputation >= 10 and $sectFavor >= 5>>
<div class="requirement-section">
<h3>Path to Disciplehood</h3>
<p class="requirement-flavor">
The path of a true Disciple requires more than raw power.
You must prove your dedication through service, earn the respect of your peers,
and demonstrate genuine commitment to the sect's values.
</p>
<div class="requirement-list">
<div class="requirement-item <<if $ContributionPoints >= 50>>met<</if>>">
<span class="requirement-icon">⚙️</span>
<span class="requirement-text">Contribution Points: <<print $ContributionPoints>>/50</span>
<div class="requirement-bar">
<div class="requirement-fill" style="width: <<print Math.min(100, ($ContributionPoints / 50) * 100)>>%"></div>
</div>
</div>
<div class="requirement-item <<if $CurrentPcSectReputation >= 10>>met<</if>>">
<span class="requirement-icon">👥</span>
<span class="requirement-text">Sect Reputation: <<print $CurrentPcSectReputation>>/10</span>
<div class="requirement-bar">
<div class="requirement-fill" style="width: <<print Math.min(100, ($CurrentPcSectReputation / 10) * 100)>>%"></div>
</div>
</div>
<div class="requirement-item <<if $sectFavor >= 5>>met<</if>>">
<span class="requirement-icon">✦</span>
<span class="requirement-text">Sect Favor: <<print $sectFavor>>/5</span>
<div class="requirement-bar">
<div class="requirement-fill" style="width: <<print Math.min(100, ($sectFavor / 5) * 100)>>%"></div>
</div>
</div>
</div>
</div>
<<elseif $CurrentPcSectRank == "Disciple">>
<<set _nextRank to "Inner Disciple">>
<<set _canPromote to $ContributionPoints >= 150 and $CurrentPcSectReputation >= 30 and $sectFavor >= 15>>
<div class="requirement-section">
<h3>The Inner Circle Awaits</h3>
<p class="requirement-flavor">
Inner Disciples stand at the threshold between novice and master.
You must have accumulated significant achievements and proven yourself
worthy of the sect's deeper mysteries and restricted knowledge.
</p>
<div class="requirement-list">
<div class="requirement-item <<if $ContributionPoints >= 150>>met<</if>>">
<span class="requirement-icon">⚙️</span>
<span class="requirement-text">Contribution Points: <<print $ContributionPoints>>/150</span>
<div class="requirement-bar">
<div class="requirement-fill" style="width: <<print Math.min(100, ($ContributionPoints / 150) * 100)>>%"></div>
</div>
</div>
<div class="requirement-item <<if $CurrentPcSectReputation >= 30>>met<</if>>">
<span class="requirement-icon">👥</span>
<span class="requirement-text">Sect Reputation: <<print $CurrentPcSectReputation>>/30</span>
<div class="requirement-bar">
<div class="requirement-fill" style="width: <<print Math.min(100, ($CurrentPcSectReputation / 30) * 100)>>%"></div>
</div>
</div>
<div class="requirement-item <<if $sectFavor >= 15>>met<</if>>">
<span class="requirement-icon">✦</span>
<span class="requirement-text">Sect Favor: <<print $sectFavor>>/15</span>
<div class="requirement-bar">
<div class="requirement-fill" style="width: <<print Math.min(100, ($sectFavor / 15) * 100)>>%"></div>
</div>
</div>
</div>
</div>
<<elseif $CurrentPcSectRank == "Inner Disciple">>
<<set _nextRank to "Core Disciple">>
<<set _canPromote to $ContributionPoints >= 300 and $CurrentPcSectReputation >= 60 and $sectFavor >= 30>>
<div class="requirement-section">
<h3>The Core of Power</h3>
<p class="requirement-flavor">
Core Disciples are rare individuals chosen to lead the sect's future.
Your cultivation must be exceptional, your wisdom proven,
and your loyalty to the sect beyond question.
You've chosen as your master <<print $plot1Mentor.fullname>>, a figure of great renown and skill.
</p>
<div class="requirement-list">
<div class="requirement-item <<if $ContributionPoints >= 300>>met<</if>>">
<span class="requirement-icon">⚙️</span>
<span class="requirement-text">Contribution Points: <<print $ContributionPoints>>/300</span>
<div class="requirement-bar">
<div class="requirement-fill" style="width: <<print Math.min(100, ($ContributionPoints / 300) * 100)>>%"></div>
</div>
</div>
<div class="requirement-item <<if $CurrentPcSectReputation >= 60>>met<</if>>">
<span class="requirement-icon">👥</span>
<span class="requirement-text">Sect Reputation: <<print $CurrentPcSectReputation>>/60</span>
<div class="requirement-bar">
<div class="requirement-fill" style="width: <<print Math.min(100, ($CurrentPcSectReputation / 60) * 100)>>%"></div>
</div>
</div>
<div class="requirement-item <<if $sectFavor >= 30>>met<</if>>">
<span class="requirement-icon">✦</span>
<span class="requirement-text">Sect Favor: <<print $sectFavor>>/30</span>
<div class="requirement-bar">
<div class="requirement-fill" style="width: <<print Math.min(100, ($sectFavor / 30) * 100)>>%"></div>
</div>
</div>
</div>
</div>
<<elseif $CurrentPcSectRank == "Core Disciple">>
<<set _nextRank to "True Disciple">>
<<set _canPromote to $ContributionPoints >= 600 and $CurrentPcSectReputation >= 100 and $sectFavor >= 50>>
<div class="requirement-section">
<h3>Ascension to True Disciplehood</h3>
<p class="requirement-flavor">
True Disciples are legendary figures, standing at the precipice of immortality.
Few ever reach this height. Those who do are destined for greatness—or ruin.
You've chosen as your master <<print $plot1Mentor.fullname>>, a figure of great renown and skill.
</p>
<div class="requirement-list">
<div class="requirement-item <<if $ContributionPoints >= 600>>met<</if>>">
<span class="requirement-icon">⚙️</span>
<span class="requirement-text">Contribution Points: <<print $ContributionPoints>>/600</span>
<div class="requirement-bar">
<div class="requirement-fill" style="width: <<print Math.min(100, ($ContributionPoints / 600) * 100)>>%"></div>
</div>
</div>
<div class="requirement-item <<if $CurrentPcSectReputation >= 100>>met<</if>>">
<span class="requirement-icon">👥</span>
<span class="requirement-text">Sect Reputation: <<print $CurrentPcSectReputation>>/100</span>
<div class="requirement-bar">
<div class="requirement-fill" style="width: <<print Math.min(100, ($CurrentPcSectReputation / 100) * 100)>>%"></div>
</div>
</div>
<div class="requirement-item <<if $sectFavor >= 50>>met<</if>>">
<span class="requirement-icon">✦</span>
<span class="requirement-text">Sect Favor: <<print $sectFavor>>/50</span>
<div class="requirement-bar">
<div class="requirement-fill" style="width: <<print Math.min(100, ($sectFavor / 50) * 100)>>%"></div>
</div>
</div>
</div>
</div>
<</if>>
</div>
<<if _canPromote>>
<div class="promotion-action">
<<link "🌟 ASCEND TO THE NEXT RANK" "Council Hall|Stage 1">>
<<if $CurrentPcSectRank == "Initiate">>
<<set $pe to 1>>
<<set $CurrentPcSectRank to "Disciple">>
<<set $promotionRank to "Disciple">>
<<elseif $CurrentPcSectRank == "Disciple">>
<<set $pe to 2>>
<<set $CurrentPcSectRank to "Inner Disciple">>
<<set $promotionRank to "Inner Disciple">>
<<elseif $CurrentPcSectRank == "Inner Disciple">>
<<set $pe to 3>>
<<set $CurrentPcSectRank to "Core Disciple">>
<<set $promotionRank to "Core Disciple">>
<<elseif $CurrentPcSectRank == "Core Disciple">>
<<set $pe to 4>>
<<set $CurrentPcSectRank to "True Disciple">>
<<set $promotionRank to "True Disciple">>
<</if>>
<</link>>
</div>
<<else>>
<div class="promotion-blocked">
<p>You must meet all requirements to advance.</p>
</div>
<</if>>
<div class="council-footer">
<<link "⬅️ Return to Sect" $passage>><</link>>
</div>
<!-- ═══════════════════════════════════════════════════════════════ -->
<!-- DISCIPLE PROMOTION CEREMONY -->
<!-- ═══════════════════════════════════════════════════════════════ -->
<<elseif $pe eq 1>>
<div class="ceremony-container">
<div class="ceremony-header">
<h2>🌙 The Rite of Ascension</h2>
</div>
<div class="ceremony-scene">
<p>
The Elder Council chamber falls silent as you step forward. The air itself seems to hold its breath.
</p>
<p>
The Sect Master rises, ancient and commanding. Qi swirls around her form like dragons of light.
"Initiate," she declares, her voice resonating through your very soul,
"you have proven yourself worthy. From this moment, you are recognized as a <b>Disciple</b>
of <<print $CurrentPcAffiliation>>."
</p>
<p>
The other Elders bow their heads in acknowledgment. A warm surge of qi flows through your body,
and you feel the sect's recognition settling into your bones.
</p>
<p>
<i>"To reward your dedication, the sect offers you a gift to aid your continued cultivation."</i>
</p>
</div>
<div class="gift-selection">
<h3>Choose Your Gift:</h3>
<div class="gift-options">
<div class="gift-card">
<h4>💊 Refining Pill</h4>
<p>A potent alchemical creation that accelerates your cultivation progress.</p>
<<link "Select" "Council Hall|Stage 1">>
<<set $pe to 0>>
<<set $discipleGiftReceived to "pill">>
<<set $exp += 500>>
<</link>>
</div>
<div class="gift-card">
<h4>🌫️ Qi Gathering Incense</h4>
<p>Rare incense that enhances your next meditation session significantly.</p>
<<link "Select" "Council Hall|Stage 1">>
<<set $pe to 0>>
<<set $discipleGiftReceived to "incense">>
<<set $insight += 50>>
<</link>>
</div>
<div class="gift-card">
<h4>💰 Spirit Stones</h4>
<p>2,500 Spirit Stones to use as you see fit in the sect's markets.</p>
<<link "Select" "Council Hall|Stage 1">>
<<set $pe to 0>>
<<set $discipleGiftReceived to "stones">>
<<set $gold += 2500>>
<</link>>
</div>
</div>
</div>
</div>
<!-- ═══════════════════════════════════════════════════════════════ -->
<!-- INNER DISCIPLE PROMOTION - MENTOR SELECTION -->
<!-- ═══════════════════════════════════════════════════════════════ -->
<<elseif $pe eq 2>>
<div class="ceremony-container">
<div class="ceremony-header">
<h2>🐉 The Inner Circle</h2>
</div>
<div class="ceremony-scene">
<p>
You stand before the Sect Master once more. This time, the chamber fills with golden light.
</p>
<p>
"Inner Disciple," the Sect Master speaks, her gaze piercing your soul,
"you have ascended beyond the common ranks. To guide you through the mysteries ahead,
you must choose a personal mentor from among our most accomplished Elders."
</p>
<p>
"This bond will shape your future. Choose wisely. Some mentors are stern taskmasters.
Others offer... more intimate forms of guidance."
</p>
<p>
Three Elders step forward, their power evident in the way the air warps around them.
</p>
</div>
<div class="mentor-selection">
<h3>Select Your Mentor:</h3>
<<if !$mentorGenerated>>
<!-- INITIALIZE MENTOR ARRAY -->
<<set $mentor = []>>
<!-- GENERATE THREE MENTORS -->
<<for _i to 0; _i < 4; _i++>>
<<CreateMentor>>
<<set $mentor[_i] = clone(_npc)>>
<<if $CurrentPcSect eq "righteous">>
<<set $mentor[_i].sectNPC to "Clear Sky Azure Dragon Pavilion">>
<<else>>
<<set $mentor[_i].sectNPC to "Ghost King Netherworld Sect">>
<</if>>
<</for>>
<<set $mentorGenerated to true>>
<</if>>
<div class="mentor-cards">
<<for _i to 0; _i < 4; _i++>>
<<if $mentor[_i]>>
<div class="mentor-card">
<div class="mentor-header">
<h4><<print $mentor[_i].fullname>></h4>
<p class="mentor-cultivation"><<print $mentor[_i].realm>></p>
</div>
<div class="mentor-details">
<p><span class="detail-label">Age:</span> <<print $mentor[_i].NPClifespan>></p>
<p><span class="detail-label">Sect:</span> <<print $mentor[_i].sectNPC>></p>
<p><span class="detail-label">Internal Trait:</span> <<print $mentor[_i].internalTrait>></p>
<p><span class="detail-label">External Trait:</span> <<print $mentor[_i].externalTrait>></p>
</div>
<div class="mentor-action">
<<capture _i>>
<<link "Choose as Mentor" "Council Hall|Stage 1">>
<!-- SET MENTOR RELATIONSHIPS -->
<<set $currentNPC to clone($mentor[_i])>>
<!-- ADD MENTOR TO NPC SYSTEM -->
<<AddNPCWithFamily $currentNPC>>
<!-- SET MENTOR AS CHOSEN -->
<<set $plot1Mentor to clone($currentNPC)>>
<<set $mentorChosen to true>>
<<set $pe to 100>>
<</link>>
<</capture>>
</div>
</div>
<</if>>
<</for>>
</div>
</div>
</div>
<<elseif $pe eq 100>>
Your new mentor, <<print $plot1Mentor.fullname>>, greets you with open arms.
<!-- Player adds mentor to their masters -->
<<set $playerRelations.masters.push($plot1Mentor.id)>>
<!-- Mentor adds player to their apprentices -->
<<set $plot1Mentor.relations.apprentices.push("player")>>
<<link "Continue" "Council Hall|Stage 1">><<set $pe to 0>><</link>>
<!-- ═══════════════════════════════════════════════════════════════ -->
<!-- CORE DISCIPLE PROMOTION -->
<!-- ═══════════════════════════════════════════════════════════════ -->
<<elseif $pe eq 3>>
<div class="ceremony-container">
<div class="ceremony-header">
<h2>⚡ Core Disciple Ascension</h2>
</div>
<div class="ceremony-scene">
<p>
The entire sect seems to tremble as you enter the inner sanctum.
All the Elders are present, seated in a perfect circle, their combined power
creating a palpable pressure in the air.
</p>
<p>
The Sect Master's eyes glow with ancient light. "You have reached a pinnacle few ever attain.
As a <b>Core Disciple</b>, you are now guardian of the sect's deepest secrets."
</p>
<p>
"Your mentor, <<print $plot1Mentor.fullname>>, has vouched for your readiness.
From this day forward, you hold authority over all disciples below your rank."
</p>
<p>
Power surges through you, settling into your meridians like a second heartbeat.
You can feel new cultivation techniques unlocking in your mind—knowledge that was forbidden before.
</p>
<p>
One of the Elders smiles enigmatically. "Come find us, when you wish to discuss...
<i>advanced studies</i>."
</p>
</div>
<div class="ceremony-rewards">
<h3>New Abilities Unlocked:</h3>
<div class="rewards-list">
<div class="reward-item">
<span class="reward-icon">👥</span>
<span class="reward-text">Authority over Junior Disciples</span>
</div>
<div class="reward-item">
<span class="reward-icon">📖</span>
<span class="reward-text">Access to Restricted Techniques</span>
</div>
<div class="reward-item">
<span class="reward-icon">🏛️</span>
<span class="reward-text">Private Training Chamber Available</span>
</div>
<div class="reward-item">
<span class="reward-icon">💕</span>
<span class="reward-text">Mentor Relationship Options Expanded</span>
</div>
</div>
</div>
<div class="ceremony-action">
<<link "Accept Your New Status" "Council Hall|Stage 1">>
<<set $pe to 0>>
<<set $coreDiscipleCeremony to true>>
<<set $maxAuthorityRank to "Disciple">>
<</link>>
</div>
</div>
<!-- ═══════════════════════════════════════════════════════════════ -->
<!-- TRUE DISCIPLE - APOTHEOSIS -->
<!-- ═══════════════════════════════════════════════════════════════ -->
<<elseif $pe eq 4>>
<div class="ceremony-container">
<div class="ceremony-header">
<h2>✨ Ascension to Legend</h2>
</div>
<div class="ceremony-scene">
<p>
The sky itself splits open with cultivated energy as you enter the Sacred Peak.
Every Elder, every Core Disciple, every master of the sect has gathered for this moment.
</p>
<p>
The Sect Master stands alone at the summit, silhouetted against a cascade of falling starlight.
</p>
<p>
"How rare," she whispers, and her voice carries to every corner of the sect.
"Another True Disciple. The heavens acknowledge your ascension."
</p>
<p>
The tribulation begins. Lightning tears across the sky, not to destroy you, but to acknowledge you.
Your body is remade, your soul refined. When the storm clears, you are no longer merely a disciple.
</p>
<p>
You are a <b>legend</b>.
</p>
<p>
The Sect Master approaches and places her palm against your forehead.
Ancient knowledge floods into you—the true history of the sect, secrets of immortality,
and knowledge of powers beyond mortal ken.
</p>
<p style="margin-top: 20px; font-style: italic; text-align: center;">
"Welcome, True Disciple. The future of the sect rests in your hands now."
</p>
</div>
<div class="ceremony-rewards">
<h3>You Have Become:</h3>
<div class="legend-status">
<p>✦ A master of cultivation beyond mortal understanding</p>
<p>✦ A political power in the sect's hierarchy</p>
<p>✦ A potential future Sect Master</p>
<p>✦ A figure of desire and power for many...</p>
</div>
</div>
<div class="ceremony-action">
<<link "Begin Your Legend" "Council Hall|Stage 1">>
<<set $pe to 0>>
<<set $trueDiscipleAchieved to true>>
<</link>>
</div>
</div>
<</if>>
</div><img src="images/Locations/Housing0.webp" class="location-bg" style="width:80%; border: 1px solid #c5a059; border-radius: 0;">
It's a modest room, but it's yours. Small window lets in the soft light of dawn, casting a warm glow on the wooden floor. A simple bed, small table and simple wardrobe are most of the furnishings. You can hear the distant sounds of the sect grounds waking up - birds chirping, footsteps on stone paths, and the faint murmur of early morning conversations.
<p class="flavor-text">This is your new home within the $CurrentPcAffiliation. It's humble, but it's a place to rest and grow as you embark on your cultivation journey.</p>
<div class="city-grid">
<br><<link '<span class="nav-card exit-btn">Leave</span>' $passage>><</link>>
<br><<link '<span class="nav-card">Stash items</span>' "Stash">><</link>>
<<link '<span class="nav-card">Rest & Sleep</span>' "Housing Rest">><</link>>
<<link '<span class="nav-card">Bathe & Groom</span>' "Housing Bathe">><</link>>
<<link '<span class="nav-card">Pleasure yourself</span>' "Pleasure yourself|Housing">><</link>>
</div><img src="images/Character/Bathing0.webp" class="location-bg" style="width:80%; border: 1px solid #c5a059; border-radius: 0;">
<h2>Rest & Recovery</h2>
<p>The day's rigors have worn you down. You change into comfortable sleeping robes and slide beneath your simple blankets. As your head touches the pillow, a wave of exhaustion washes over you.</p>
<p>Sleep claims you swiftly and deeply. Your dreams are filled with visions of spiritual cultivation—endless gardens of heavenly herbs, ancient temples suspended in clouds, and the flowing currents of cosmic qi surrounding you in an embrace of power and serenity.</p>
<p>When you awaken, the sun has moved across the sky. You feel refreshed, renewed, ready to face whatever challenges await.</p>
<p>✦ A new day awaits your return to the sect grounds.</p>
<<link "Continue to Sect Grounds" $passage>><</link>><h2>Bathe & Groom</h2>
<img src="images/Character/Awake0.webp" class="location-bg" style="width:80%; border: 1px solid #c5a059; border-radius: 0;">
<p>You step into the small bathing area attached to your quarters. The warm water soothes your muscles and washes away the grime of the day. As you bathe, you take a moment to reflect on your journey so far and the path ahead.</p>
<p>After drying off, you groom yourself with care, ensuring you're presentable for interactions within the sect. A clean appearance can make a good impression on your fellow disciples and superiors.</p>
<p>✦ A new day awaits your return to the sect grounds.</p>
<<link "Continue to Sect Grounds" $passage>><</link>><h2>Intimate Moments</h2>
<p>You slip the latch on your door and draw the thin curtain across the small window. The morning light softens to a warm amber haze. In the quiet of your quarters, with the distant sounds of the sect drifting away, you allow yourself this — a moment entirely your own.</p>
<p>You consider what you have available...</p>
<div class="pleasure-options">
<<link "Use your hands — the simplest pleasure">>
<<goto "MasturbationScene_NoToy">>
<</link>><br><br>
<<if $playeriteminventory.some(i => i.id === "jadeprobe")>>
<<link "Retrieve the Jade Probe from your stash">>
<<goto "MasturbationScene_JadeProbe">>
<</link>><br><br>
<</if>>
<<if $playeriteminventory.some(i => i.id === "phoenixfeatherplug")>>
<<link "Take out the Phoenix Feather Plug">>
<<goto "MasturbationScene_PhoenixPlug">>
<</link>><br><br>
<</if>>
<<if $playeriteminventory.some(i => i.id === "lotusbeads")>>
<<link "Unwrap the Lotus Bead String">>
<<goto "MasturbationScene_LotusBeads">>
<</link>><br><br>
<</if>>
<<link "Perhaps another time...">>
<<goto "Housing">>
<</link>>
</div><h2>Simplest Pleasure</h2>
<p>You sink onto the edge of your bed, the worn blanket soft beneath you. No tools, no aids — only your own hands and the quiet permission you give yourself.</p>
<p>You lie back slowly, staring up at the ceiling's rough wooden beams, and let your breathing deepen. One hand slides beneath the loose fabric of your inner robe, tracing the curve of your stomach, the warmth of your own skin unfamiliar yet intimate in a way that makes something loosen in your chest.</p>
<p>Your fingers drift lower. You part your thighs and close your eyes.</p>
<p>It begins slowly — gentle, exploratory — the pad of your fingers circling, finding the places that make your breath catch. You move without urgency, learning yourself the way a cultivator learns a new technique: with patience, with attention. Your hips shift. A soft sound escapes your lips before you press them together.</p>
<p>The pleasure builds in unhurried waves. Your fingers find a rhythm and hold it, the warmth spreading upward through your belly, into your chest. Your free hand presses flat against the mattress, grounding you. The distant sounds of the sect feel very far away now.</p>
<p>When the peak finally breaks over you, it is quiet and complete — a soft shudder, a held breath released, your body going still and then loose. You lie there for a long moment afterward, one arm thrown over your eyes, your heart slowing.</p>
<p><em>Simple,</em> you think. <em>But enough.</em></p>
<p>You rise, straighten your robes, and smooth your hair. The morning waits.</p>
<<set $energy += 5>>
[[Return to your room.|Housing]]<h2>The Jade Probe</h2>
<p>You reach into your stash and close your fingers around the Jade Probe. Even before you unwrap it fully, you can feel the faint warmth emanating from within the smooth stone.</p>
<p>You take it to your bed.</p>
<p>Lying back, you hold the probe above you for a moment. The jade is flawless - a deep, misted green, carved with subtle ridges along its length that follow the lines of theoretical meridian maps you half-remember from your introductory cultivation texts. Whoever made this understood anatomy in ways that went beyond medicine.</p>
<p>You touch the tip to your inner thigh first. The jade has warmed to match your skin and the contact draws a slow exhale from you.</p>
<p>You take your time preparing yourself, your own fingers working first until your breathing has deepened and your body is ready. Then you guide the probe carefully into place.</p>
<p>The sensation is immediate and layered — the fullness of it, the smooth pressure against your inner walls, and beneath that, the unmistakable tingle of qi beginning to move. Subtle at first, barely distinguishable from ordinary arousal, but as you begin to move the probe in slow, deliberate strokes, it builds into something with a character all its own. </p>
<p>Your hips roll instinctively. Your free hand presses over your lower abdomen as if trying to hold the sensation in place.</p>
<p>You work yourself slowly toward the edge, the jade's internal rhythm syncing with your breathing until the two are indistinguishable. When the release comes it arrives with unusual depth — not just physical but something beneath it, your core meridians flushing with warmth that lingers long after your body has stilled.</p>
<p>You lie with the probe resting against your stomach, breathing, feeling the residual qi settle.</p>
<p><em>Yin essence refinement,</em> the pamphlet tucked inside its wrapping had called it. You had thought it euphemism. You are no longer certain.</em></p>
<<set $energy += 10>>
<<set $corruption += 1>>
[[Return to your room.|Housing]]<h2>The Phoenix Feather Plug</h2>
<p>You unwrap the Phoenix Feather Plug from its silk cloth with the careful hands of someone handling something that embarrasses and fascinates them in equal measure.</p>
<p>The jade tapers to a narrow tip that widens into a smooth, full body before narrowing again at the base — a delicate, precise thing. The phoenix feather tail fans out at the end, rust-red and gold, impossibly soft when you brush it against your wrist. It looks almost decorative. It is not.</p>
<p>You prepare yourself at the edge of your bed, kneeling forward over your folded arms, breathing deliberately slow.</p>
<p>You work the plug in gradually — carefully, patiently — the smooth jade offering little resistance once you have relaxed enough to accept it. The fullness that settles there when it seats itself completely is dense and insistent, a pressure in a place you are not accustomed to being aware of. Your breath stutters. You hold still for a long moment, adjusting.</p>
<p>Then the plug warms.</p>
<p>It begins as a gentle heat, the yang fire the plug's description promised — a slow burn that radiates outward from where it sits nestled inside you, moving in pulses along the rear meridian pathways. You press your face into your folded arms and make a sound that you are grateful no one is here to hear.</p>
<p>You lower yourself carefully to lie face-down on the bed, the feather tail splayed against the small of your back, and let your hand work between your thighs. The combination is overwhelming in a way that is almost too much and precisely enough — the external pleasure and the deep interior warmth moving through you simultaneously, each amplifying the other.</p>
<p>The climax, when it comes, makes you grip the mattress and press your teeth together. It rolls through you in waves, the yang energy dissipating outward from your core in a slow, flushing heat that leaves you limp and vaguely astonished.</p>
<p>You roll onto your side carefully, the plug still in place, and stare at the wall for a while, thinking of nothing in particular.</p>
<p><em>Forbidden pleasure cultivation,</em> you think. <em>Yes. That is exactly what that was.</em></p>
<<set $energy += 10>>
<<set $corruption += 1>>
[[Return to your room.|Housing]]<h2>The Lotus Bead String</h2>
<p>You lift the Lotus Bead String from its pouch and let it pool in your palm. Rose quartz, graduated from small to large — nine beads, each one smooth and faintly translucent, strung on a cord of braided silk. They catch the morning light and scatter it in soft pink constellations across your skin.</p>
<p>Even before use they carry a faint vibration — a resonance you feel more than hear, a hum at the very edge of perception. Yin qi, concentrated and refined.</p>
<p>You take your time.</p>
<p>Lying back on your bed, you spend several long minutes simply breathing, letting your body relax fully — your cultivator's discipline turned inward, toward softness rather than rigor. Then you begin.</p>
<p>You choose vaginal insertion first. The smallest bead slides home easily and the vibration it emits inside you is immediate and startling — a focused, resonant pulse that seems to speak directly to something deep in your meridians. You add the next bead. Then the next. Each one broader than the last, each one contributing its own frequency to the growing chorus within you until you are stretched full and trembling faintly, your inner walls clenching around the string involuntarily.</p>
<p>You reach the point where you can take no more and simply lie there for a moment, breathing through your mouth, the beads humming their collective song inside you while your fingers work slow circles at the apex of your thighs.</p>
<p>When you pull the string, you do it slowly — one bead at a time — and each withdrawal sends a distinct pulse of yin qi flooding outward through your meridians like a struck string resonating. You cry out softly on the fourth bead and bite down on your knuckle by the sixth.</p>
<p>The final bead pulls free and the release that crashes through you is unlike any simple physical pleasure — it is as though every meridian in your lower body fires at once, a full-body resonance that leaves you flat and breathless and oddly, profoundly calm in its aftermath.</p>
<p>You clean the beads carefully with the cloth from the pouch and rewrap them, your hands still faintly unsteady.</p>
<p><em>Extended masturbation sessions and meridian stretching,</em> the inscription on the pouch read. <em>You are beginning to understand that description as technically precise.</em></p>
<<set $energy += 12>>
<<set $corruption += 3>>
[[Return to your room.|Housing]]\
\
<<set _currentRankIndex = $sectRanks.indexOf($CurrentPcSectRank)>>\
<<if $selectedFloor eq null>>\
<<set $selectedFloor = "Initiate">>\
<</if>>\
<div class="floor-selector" style="margin-bottom: 1em;">\
<<link "Go back" $passage>><<set $pe to 0>> <</link>>\
<<if _currentRankIndex gte $sectRanks.indexOf("Initiate")>>
<<link "📘 Floor I" "Manual Library|Stage 1">><<set $selectedFloor = "Initiate">><</link>>\
<</if>>\
<<if _currentRankIndex gte $sectRanks.indexOf("Disciple")>>
<<link "📙 Floor II" "Manual Library|Stage 1">><<set $selectedFloor = "Disciple">><</link>>\
<</if>>\
</div>\
\
<<set _floorRank = $selectedFloor>>\
<<set _floorIndex = $sectRanks.indexOf(_floorRank)>>\
<<set _floorLabel = _floorRank.toUpperCase()>>\
<<if _currentRankIndex >= _floorIndex>>\
\
\
\
<h2 class="floor-header">📜 Manual Library – <<= _floorLabel >></h2>\
<<set _manualList = $sectManuals[$CurrentPcSect][_floorRank]>>\
\
<<if _manualList and _manualList.length > 0>>\
<<for _manual range _manualList>>\
<<capture _manual>>\
<div class="manual-entry" style="border:1px solid #444; border-radius:8px; padding:0.75em; margin-bottom:1em; background:#1a1a1a; color:#e0e0e0;">
<h4 style="margin:0 0 0.2em 0;">\
<<= _manual.name >> \
<span style="font-size: 0.8em; font-weight: normal; color:#aaa;">[<i><<= _manual.category >> Manual</i>]</span>\
</h4>\
<p style="margin:0 0 0.5em 0;"><small><<= _manual.description >></small></p>\
<p style="margin:0 0 0.5em 0;">🪙 <b>Cost:</b> <span style="color:#ffe28a;"><<= _manual.ContributionPointCost >> CP</span></p>\
\
<<set _alreadyKnown = $skillInventory.some(x => x.skillid == _manual.skillid)>>\
\
<<if _alreadyKnown>>\
<div class="manual-note" style="color:#6cff6c;">✔️ You already possess this manual.</div>\
<<else>>\
<<if $ContributionPoints >= _manual.ContributionPointCost>>\
<<link "Learn this Manual" "Manual Library|Stage 1">>\
<<set $ContributionPoints -= _manual.ContributionPointCost>>\
<<set $skillInventory.push(clone(_manual))>>\
You’ve successfully acquired the <<=_manual.name>> manual!
<<replace "#manuals">><<include "ManualLibrary">>\<</replace>>\
<</link>>\
<<else>>\
<div class="manual-note" style="color:#ff6666;">❌ Not enough Contribution Points.</div>\
<</if>>\
<</if>>\
</div>\
<</capture>>\
<</for>>\
\
<<else>>\
<p style="color:#aaa;">📭 No manuals available on this floor.</p>
<</if>>\
\
<<else>>\
<p style="color:#999;">🚫 You do not have permission to access this floor.</p>
<</if>>\
\
<div id="manuals"></div>\<<set _currentRankIndex = $sectRanks.indexOf($CurrentPcSectRank)>>
<<if !$SectSideMissions or $SectSideMissions.length == 0>>
<<refreshMissions>>
<</if>>
<<set _availableMissions = $SectSideMissions
.filter(m => {
if (!m.requiredRank) {
return true;
}
return $sectRanks.indexOf(m.requiredRank) <= _currentRankIndex;
})
.shuffle()
.slice(0, 3)
>>
<div class="sect-mission-container">
<div class="mission-header">
<h2>Mission Hall</h2>
<p class="mission-subtitle">Undertake tasks for sect advancement</p>
</div>
<div class="missions-list">
<<for _mission range _availableMissions>>
<div class="mission-entry sect-mission">
<div class="mission-top">
<div class="mission-info">
<p class="mission-name"><<print _mission.name>></p>
<p class="mission-description"><<print _mission.description>></p>
<!-- KNOWN COMBAT: Show enemy realm -->
<<if _mission.isCombat eq true and _mission.enemyRealm>>
<div class="mission-enemy-info">
<span class="enemy-label">Expected Enemy:</span>
<span class="enemy-realm"><<print _mission.enemyStage>> <<print _mission.enemyRealm>></span>
</div>
<!-- UNKNOWN COMBAT: Show ??? -->
<<elseif _mission.isCombat eq "unknown">>
<div class="mission-enemy-info">
<span class="enemy-label">Possible Threat:</span>
<span class="enemy-unknown">??? Unknown ???</span>
</div>
<</if>>
<!-- TWIST EVENT -->
<<if _mission.twistEvent>>
<div class="mission-twist-note">
<span class="twist-label">⚠ Special Event</span>
</div>
<</if>>
</div>
<div class="mission-reward">
<span class="reward-value"><<print _mission.reward>></span>
<span class="reward-label">contribution</span>
<<if _mission.favor>>
<span class="reward-value" style="font-size: 0.9em; margin-top: 4px;">+<<print _mission.favor>></span>
<span class="reward-label">favor</span>
<</if>>
</div>
</div>
<div class="mission-actions">
<<if $SideMissionStatus is null>>
<<capture _mission>>
<<link "Accept Mission" "Mission Hall|Stage 1">>
<<set $activeSideMission to _mission>>
<<set $SideMissionStatus to "accepted">>
<<set $MissionType to "sect">>
<<set $activeSideMission.missionCordX to $playerX>>
<<set $activeSideMission.missionCordY to $playerY>>
<<replace "#missionlog">><div class="mission-accepted">✓ Accepted: <<= _mission.name>></div><</replace>>
<</link>>
<</capture>>
<</if>>
</div>
</div>
<</for>>
</div>
<div id="missionlog"></div>
<<if $activeSideMission neq null>>
<div class="active-mission-panel">
<h3>Current Mission</h3>
<p><strong><<print $activeSideMission.name>></strong></p>
<p class="mission-description"><<print $activeSideMission.description>></p>
<!-- KNOWN COMBAT: Show expected enemy -->
<<if $activeSideMission.isCombat eq true and $activeSideMission.enemyRealm>>
<div class="enemy-info">
<span class="enemy-label">Expected Enemy:</span>
<span class="enemy-realm"><<print $activeSideMission.enemyStage>> <<print $activeSideMission.enemyRealm>></span>
</div>
<!-- UNKNOWN COMBAT: Show unknown status -->
<<elseif $activeSideMission.isCombat eq "unknown">>
<div class="enemy-info">
<span class="enemy-label">Possible Threat:</span>
<span class="enemy-unknown">??? Unknown ???</span>
</div>
<</if>>
<div class="reward-info">
Reward: <<print $activeSideMission.reward>> contribution points
<<if $activeSideMission.favor>>
+ <<print $activeSideMission.favor>> sect favor
<</if>>
</div>
<div class="mission-controls">
<<if $activeSideMission.missionCordX eq $playerX and $activeSideMission.missionCordY eq $playerY>>
<<link "You're on mission location! Start mission" "Mission|Region1">><</link>>
<</if>>
<<link "Abandon Mission" "Mission Hall|Stage 1">>
<<set $activeSideMission to null>>
<<set $SideMissionStatus to null>>
<<replace "#missionlog">><div class="mission-abandoned">✗ Mission abandoned</div><</replace>>
<</link>>
</div>
</div>
<</if>>
<div class="mission-controls-bottom">
<<link "⟳ Refresh Missions" "Mission Hall|Stage 1">>
<<refreshMissions>>
<</link>>
<<link "Leave Hall" $passage>><</link>>
</div>
</div><<if $pe eq 0>>
<div class="spirit-pavilion">
<h3>🌌 Spirit Pavilion</h3>
<p>You may rent a chamber here and meditate in peace. The cost is <b>3 Contribution Points</b> for <b>1 EXP</b>.</p>
<p><b>You currently have:</b> <span style="color:#ffe28a;"><<= $ContributionPoints >> Contribution Points</span></p>
<label for="spiritInput">How many Contribution Points do you wish to spend?</label><br>
<<textbox "$spiritpavilion" $spiritpavilion size 5>>
<div style="text-align: center;" class="action-btn">
<<link "Meditate">>
<<set $spiritpavilion = parseInt($spiritpavilion)>>
<<if isNaN($spiritpavilion) or $spiritpavilion <= 0>>
<<replace "#meditationResult">><div id="meditationResult" style="color: #ff6666;">⚠️ Please enter a valid number greater than 0.</div><</replace>>
<<elseif $ContributionPoints < $spiritpavilion>>
<<replace "#meditationResult">><div id="meditationResult" style="color: #ff6666;">❌ You do not have enoughContribution Points.</div><</replace>>
<<else>>
<<set _expGained = Math.floor($spiritpavilion / 3)>>
<<set $ContributionPoints -= $spiritpavilion>>\
<<set $exp += _expGained>>\
<<set $pe = 1>>\
<<replace "#meditationResult">>
<div id="meditationResult" style="color: #6cff6c;">✅ You meditated successfully and gained <b><<= _expGained >> EXP</b>.</div>
<</replace>>\
<</if>>\
<</link>>\
<br><<link "Leave" $passage>><<set $pe = 0>><</link>>
</div>
<div id="meditationResult" style="margin-top:1em;"></div>
</div>\
\
\
<</if>><div class="stash-management-container">
<div class="stash-header">
<h1>Sacred Spatial Repository</h1>
<p>Exchange treasures between your stash and personal inventory with divine ease.</p>
</div>
<<if $playerstashinventory eq null>><<set $playerstashinventory to []>><</if>>
<div class="dual-inventory-layout">
<!-- LEFT COLUMN: STASH -->
<div class="inventory-column stash-column">
<div class="column-header stash-header-title">
<h2>Spatial Stash</h2>
<p>Your hidden pocket of space</p>
</div>
<!-- STASH ITEMS -->
<div class="inventory-section">
<h3 class="section-title">Treasured Items</h3>
<<if $playerstashinventory.filter(item => item.type === "item" || item.type === undefined).length gt 0>>
<table class="transfer-inventory-table">
<thead>
<tr>
<th style="width: 60px;"></th>
<th>Item</th>
<th style="width: 80px; text-align: center;">Qty</th>
<th style="width: 100px; text-align: center;">Action</th>
</tr>
</thead>
<tbody>
<<for _item range $playerstashinventory>>
<<if _item.type === "item" || _item.type === undefined>>
<<if _item.quantity gt 0>>
<tr class="transfer-row">
<td style="text-align: center;">
<div class="item-icon">宝</div>
</td>
<td>
<<hovertip _item.description>>
<div class="item-name"><<print _item.name>></div>
<</hovertip>>
</td>
<td style="text-align: center;">
<div class="quantity-display"><<print _item.quantity>></div>
</td>
<td style="text-align: center;">
<<capture _item>>
<<link "→" `passage()`>>
<<if _item.quantity gt 0>>
<<set _item.quantity -= 1>>
<<if $playeriteminventory.some(i => i.name === _item.name)>>
<<set $playeriteminventory.find(i => i.name === _item.name).quantity += 1>>
<<else>>
<<set $playeriteminventory.push(clone(_item))>>
<<set $playeriteminventory[$playeriteminventory.length - 1].quantity to 1>>
<</if>>
<<if _item.quantity <= 0>>
<<set $playerstashinventory.deleteAt($playerstashinventory.indexOf(_item))>>
<</if>>
<</if>>
<</link>>
<</capture>>
</td>
</tr>
<</if>>
<</if>>
<</for>>
</tbody>
</table>
<<else>>
<div class="empty-container">
<p>No items stored.</p>
<p>Transfer treasures from your inventory here.</p>
</div>
<</if>>
</div>
<!-- STASH POTIONS -->
<div class="inventory-section">
<h3 class="section-title">Elixirs & Potions</h3>
<<if $playerstashinventory.filter(item => item.type === "potion").length gt 0>>
<table class="transfer-elixir-table">
<thead>
<tr>
<th style="width: 60px;"></th>
<th>Elixir</th>
<th style="width: 70px; text-align: center;">Grade</th>
<th style="width: 60px; text-align: center;">Qty</th>
<th style="width: 100px; text-align: center;">Action</th>
</tr>
</thead>
<tbody>
<<for _potion range $playerstashinventory>>
<<if _potion.type === "potion">>
<<if _potion.quantity gt 0>>
<<set _rarityColor to
(_potion.grade <= 1 ? "#4fc3f7" :
_potion.grade <= 3 ? "#66bb6a" :
_potion.grade <= 5 ? "#ffa726" :
"#ab47bc")>>
<tr class="transfer-row">
<td style="text-align: center;">
<div class="elixir-icon">丹</div>
</td>
<td>
<<hovertip _potion.description>>
<div class="item-name" style="color: <<print _rarityColor>>;"><<print _potion.name>></div>
<</hovertip>>
</td>
<td style="text-align: center; color: <<print _rarityColor>>; font-weight: bold;">
<<print _potion.grade>>
</td>
<td style="text-align: center;">
<div class="quantity-display"><<print _potion.quantity>></div>
</td>
<td style="text-align: center;">
<<capture _potion>>
<<link "→" `passage()`>>
<<if _potion.quantity gt 0>>
<<set _potion.quantity -= 1>>
<<if $playerpotioninventory.some(p => p.name === _potion.name)>>
<<set $playerpotioninventory.find(p => p.name === _potion.name).quantity += 1>>
<<else>>
<<set $playerpotioninventory.push(clone(_potion))>>
<<set $playerpotioninventory[$playerpotioninventory.length - 1].quantity to 1>>
<</if>>
<<if _potion.quantity <= 0>>
<<set $playerstashinventory.deleteAt($playerstashinventory.indexOf(_potion))>>
<</if>>
<</if>>
<</link>>
<</capture>>
</td>
</tr>
<</if>>
<</if>>
<</for>>
</tbody>
</table>
<<else>>
<div class="empty-container">
<p>No elixirs stored.</p>
<p>Preserve rare potions in your stash.</p>
</div>
<</if>>
</div>
</div>
<!-- RIGHT COLUMN: INVENTORY -->
<div class="inventory-column inventory-column-active">
<div class="column-header inventory-header-title">
<h2>Personal Inventory</h2>
<p>Items at hand for your journey</p>
</div>
<!-- INVENTORY ITEMS -->
<div class="inventory-section">
<h3 class="section-title">Treasured Items</h3>
<<if $playeriteminventory.filter(item => item.quantity gt 0).length gt 0>>
<table class="transfer-inventory-table">
<thead>
<tr>
<th style="width: 60px;"></th>
<th>Item</th>
<th style="width: 80px; text-align: center;">Qty</th>
<th style="width: 100px; text-align: center;">Action</th>
</tr>
</thead>
<tbody>
<<for _item range $playeriteminventory>>
<<if _item.quantity gt 0>>
<tr class="transfer-row">
<td style="text-align: center;">
<div class="item-icon">宝</div>
</td>
<td>
<<hovertip _item.description>>
<div class="item-name"><<print _item.name>></div>
<</hovertip>>
</td>
<td style="text-align: center;">
<div class="quantity-display"><<print _item.quantity>></div>
</td>
<td style="text-align: center;">
<<capture _item>>
<<link "←" `passage()`>>
<<if _item.quantity gt 0>>
<<set _item.quantity -= 1>>
<<if $playerstashinventory.some(i => i.name === _item.name)>>
<<set $playerstashinventory.find(i => i.name === _item.name).quantity += 1>>
<<else>>
<<set $playerstashinventory.push(clone(_item))>>
<<set $playerstashinventory[$playerstashinventory.length - 1].quantity to 1>>
<</if>>
<<if _item.quantity <= 0>>
<<set $playeriteminventory.deleteAt($playeriteminventory.indexOf(_item))>>
<</if>>
<</if>>
<</link>>
<</capture>>
</td>
</tr>
<</if>>
<</for>>
</tbody>
</table>
<<else>>
<div class="empty-container">
<p>Your hands are empty.</p>
<p>Retrieve items from your stash or collect new treasures.</p>
</div>
<</if>>
</div>
<!-- INVENTORY POTIONS -->
<div class="inventory-section">
<h3 class="section-title">Elixirs & Potions</h3>
<<if $playerpotioninventory.filter(potion => potion.quantity gt 0).length gt 0>>
<table class="transfer-elixir-table">
<thead>
<tr>
<th style="width: 60px;"></th>
<th>Elixir</th>
<th style="width: 70px; text-align: center;">Grade</th>
<th style="width: 60px; text-align: center;">Qty</th>
<th style="width: 100px; text-align: center;">Action</th>
</tr>
</thead>
<tbody>
<<for _potion range $playerpotioninventory>>
<<if _potion.quantity gt 0>>
<<set _rarityColor to
(_potion.grade <= 1 ? "#4fc3f7" :
_potion.grade <= 3 ? "#66bb6a" :
_potion.grade <= 5 ? "#ffa726" :
"#ab47bc")>>
<tr class="transfer-row">
<td style="text-align: center;">
<div class="elixir-icon">丹</div>
</td>
<td>
<<hovertip _potion.description>>
<div class="item-name" style="color: <<print _rarityColor>>;"><<print _potion.name>></div>
<</hovertip>>
</td>
<td style="text-align: center; color: <<print _rarityColor>>; font-weight: bold;">
<<print _potion.grade>>
</td>
<td style="text-align: center;">
<div class="quantity-display"><<print _potion.quantity>></div>
</td>
<td style="text-align: center;">
<<capture _potion>>
<<link "←" `passage()`>>
<<if _potion.quantity gt 0>>
<<set _potion.quantity -= 1>>
<<if $playerstashinventory.some(p => p.name === _potion.name)>>
<<set $playerstashinventory.find(p => p.name === _potion.name).quantity += 1>>
<<else>>
<<set $playerstashinventory.push(clone(_potion))>>
<<set $playerstashinventory[$playerstashinventory.length - 1].quantity to 1>>
<</if>>
<<if _potion.quantity <= 0>>
<<set $playerpotioninventory.deleteAt($playerpotioninventory.indexOf(_potion))>>
<</if>>
<</if>>
<</link>>
<</capture>>
</td>
</tr>
<</if>>
<</for>>
</tbody>
</table>
<<else>>
<div class="empty-container">
<p>No elixirs in hand.</p>
<p>Retrieve potions from your stash when needed.</p>
</div>
<</if>>
</div>
</div>
</div>
<div class="stash-actions">
<<link "Return to Housing" "Housing">><</link>>
</div>
</div>You wandered for a while, but you couldn't found anything interesting!
<<link "Go back" $passage>> <<set $pe to 0>> <</link>><<nobr>>
<<set $origin = passage()>>
<div class="brothel-container">
<div class="location-header" style="text-align:center;">
<img src="images/Locations/Brothel.jpg" class="location-bg" width="60%">
<h2 style="color:#d4af37; text-shadow: 2px 2px 4px #000;">✦ The Crimson Blossom Brothel ✦</h2>
<p style="font-style:italic; color:#b09070;">A sanctuary of earthly delights where incense smoke veils the transaction of spirit stones for fleeting ecstasy.</p>
</div>
<<set _courtesans = []>>
<<for _i = 0; _i lt random(3,4); _i++>>
<<set _gender to ["male","female"].random()>>
<<set _name = (_gender == "male" ? $male_npc_names.random() : $female_npc_names.random())>>
<<set _surname = $npc_surnames.random()>>
<<set _fullname = _surname + " " + _name>>
<<set _price = random(60, 120)>>
<<set _courtesans.push({
fullname: _fullname,
gender: _gender,
charm: random(30,85),
depravity: random(20,90),
skill: random(30,100),
price: _price
})>>
<</for>>
<div class="brothel-actions">
<h3 style="text-align:center; color:#d4af37;">🏮 Tonight's Attendants 🏮</h3>
<div class="grid-2col">
<<for _c range _courtesans>>
<<capture _c>>
<div class="courtesan-card">
<span class="courtesan-name">_c.fullname</span>
<span class="attr-label">Identity:</span> <span class="${_c.gender}">_c.gender</span><br>
<span class="attr-label">Charm:</span> _c.charm | <span class="attr-label">Depravity:</span> _c.depravity<br>
<div class="price-tag">Price: _c.price Spirit Stones</div>
<div style="margin-top:10px;">
<<if $gold gte _c.price>>
<<link "Enter Private Chamber">>
<<set $gold -= _c.price>>
<<set _courtesanObj = {
fullname: _c.fullname,
gender: _c.gender,
id: "courtesan_" + _i + "_" + Date.now()
}>>
<<set $sexPartner = _courtesanObj>>
<<set $sexType = "brothel_hire">>
<<set $sexReturnPassage = $origin>>
<<goto "EncounterInteractionSex">>
<</link>>
<<else>>
<span style="color:#666; font-size:0.9em;">[Insufficient Spirit Stones]</span>
<</if>>
</div>
</div>
<</capture>>
<</for>>
</div>
<<if $corruption > 50>>
<div class="work-option">
<h3 style="color:#ff69b4;">💃 Sell Your Services</h3>
<p>The Madam looks you up and down, a wicked smile spreading as her eyes appraise your assets. "Oh, you'll do perfectly," she murmurs. "The patrons are going to pay a absolute fortune to wear out a body like yours tonight."</p>
<<link "Work the Night Shift">>
<<set $sexPartner = "the Madam's clients">>
<<set $sexType = "brothel_work">>
<<set $sexReturnPassage = $origin>>
<<goto "EncounterInteractionSex">>
<</link>>
</div>
<</if>>
<div style="text-align:center; margin-top:30px;">
<<link "Return to the City Streets" $city>><</link>>
</div>
</div>
<div id="interaction-result"></div>
</div>
<</nobr>><div class="inn-scene">
<<if $pe eq 0>>
<<setupInn>>
<p>You push open the creaking wooden doors of the inn. A faint scent of herbal incense hangs in the air.</p>
<<if $roomAvailable lt 30>>
<div class="dialogue">
"I'm sorry, but we're fully booked tonight. A merchant caravan arrived just before sunset."
</div>
<<link "Leave the Inn" $passage>><<set $pe to 0>><</link>>
<<else>>
<div class="dialogue">
"Welcome, traveler. A good night's rest will restore your strength."
</div>
<p class="cost-tag">Cost: $innStayCost Spirit Stones</p>
<<if $gold gte $innStayCost>>
<<link "Rent a room and rest" "Inn">>
<<set $pe to 1>>
<</link>>
<<else>>
<p class="warning">"You don't have enough coin," the innkeeper says coldly.</p>
<</if>>
<br>
<<link "Go back" $passage>><<set $pe to 0>><</link>>
<</if>>
<<elseif $pe eq 1>>
<<set _eventRoll to random(1, 100)>>
<p>You sleep soundly through the night. Your body heals and your qi stabilizes.</p>
<<if _eventRoll gte 85>>
/* NSFW Event Trigger */
<p class="dialogue">A sudden, oppressive warmth floods the room. The air grows heavy with a musky scent. You are not alone.</p>
<<link "Open your eyes" InnEvent_NSFW>><</link>>
<<elseif _eventRoll lte 15>>
/* Bad Event: Thievery */
<p class="warning">You wake up to find your coin purse lighter. Someone picked your lock!</p>
<<set $gold -= 10>>
<<link "Wake up" $passage>><<set $pe to 0>><</link>>
<<else>>
/* Standard Rest */
<p>You feel refreshed and restored.</p>
<<restEffect>>
<<link "Wake up" $passage>><<set $pe to 0>><</link>>
<</if>>
<</if>>
</div><<if $pe eq 0>>
<img src="images/Locations/market.webp" class="location-bg" style="width:80%; border: 1px solid #c5a059; border-radius: 0;">
<<link "Go back" $passage>><<set $pe to 0>><</link>>
You enter the bustling market square, where merchants hawk their wares and the air is thick with the scent of exotic spices and herbs. Colorful stalls line the streets, each offering unique items from across the realm.
<<link "Mysterious Pill Forge" "Market">><<set $pe to 1>><</link>>
<<link "Thunderclap Sword Forge" "Market">><<set $pe to 11>><</link>>
<<link "Bliss Furnace Pavilion" "Market">><<set $pe to 21>><</link>>
<<elseif $pe eq 1>>
<<nobr>>
<img src="images/Locations/AzureCauldronPavilion.webp" class="location-bg" style="width:80%; border: 1px solid #c5a059; border-radius: 0;">
<br>You approach the Azure Cauldron Pavilion, where a robed pill refiner tends bubbling cauldrons of spiritual elixirs. The air hums with pure qi and the scent of rare herbs.
<div style="margin:20px 0; padding:15px; background:rgba(30,60,100,0.5); border:2px solid #ffd700; border-radius:10px;">
<br><<link "Go back" $passage>><<set $pe to 0>><</link>>
<br><<link "Browse pills" "Market">><<set $pe to 2>><</link>>
<br><<link "Look for recipes" "Market">><<set $pe to 5>><</link>>
<br><<link "Chat with the alchemist">>
<<set _talk to true>>
<<replace "#chat-output">>The alchemist leans closer with a sly smile and says: <span class="male1">"<<print $azureCauldronChat.random()>>"</span><</replace>><</link>>
<br><span id="chat-output"></span>
</div>
<</nobr>>
<<elseif $pe eq 2>>
<div class="merchant-header">
<h2>The Mysterious Pill Forge</h2>
<p>The air hums with alchemical qi as colorful elixirs glow faintly within jade bottles.</p>
</div>
<<link "Return to Market" "Market">><<set $pe to 0>><</link>>
You open your satchel to reveal your Spirit Stones: <strong><span class="gold-amount"><<print $gold>></span> Spirit Stones</strong>
<<nobr>>
<<if $purchase neq null>>
<p style="color: #4fc3f7; font-weight: bold; margin-top: 20px; text-align: center;">
<br>You have acquired <<print $purchase>>.
</p>
<<unset $purchase>>
<<unset $purchaseclass>>
<</if>>
<</nobr>>
<table class="merchant-table">
<thead>
<tr>
<th>Elixir Offerings</th>
<th style="width: 150px; text-align: center;">Price</th>
<th style="width: 100px; text-align: center;">Purchase</th>
</tr>
</thead>
<tbody>
<<for _i to 0; _i lt $mysteriouspillforgeInventory.length; _i++>>
<<set _item to $mysteriouspillforgeInventory[_i]>>
<tr>
<td>
<div class="item-name"><<print _i + 1>>. <<print _item.name>></div>
<div class="item-desc"><<print _item.description>></div>
</td>
<td style="text-align: center; vertical-align: middle;">
<div class="item-price"><<print _item.price>> Spirit Stones</div>
</td>
<td style="text-align: center; vertical-align: middle;">
<<if _item.price gt $gold>>
<span class="not-enough">Not enough gold</span>
<<else>>
<<capture _item>>
<<link "Buy" "Market">>
<<set _found to false>>
<<set _index to -1>>
<<for _j to 0; _j lt $playerpotioninventory.length; _j++>>
<<if $playerpotioninventory[_j].name === _item.name>>
<<set _found to true>>
<<set _index to _j>>
<<break>>
<</if>>
<</for>>
<<if _found>>
<<set $playerpotioninventory[_index].quantity += 1>>
<<else>>
<<set _newItem to clone(_item)>>
<<set _newItem.quantity to 1>>
<<set $playerpotioninventory.push(_newItem)>>
<</if>>
/* Deduct gold and show purchase message */
<<set $gold -= _item.price>>
<<set $purchase to _item.name>>
<<set $purchaseclass to _item.class>>
<</link>>
<</capture>>
<</if>>
</td>
</tr>
<</for>>
</tbody>
</table>
<<elseif $pe eq 5>>
<<nobr>>
/* On first visit, shuffle and pick 4-6 items to display */
<<if !$pillforgDisplayed or $pillforgDisplayed.length is 0>>
<<set _shuffled to $mysteriouspillforgePillRecipeInventory.slice()>>
/* Fisher-Yates shuffle */
<<set _len to _shuffled.length - 1>>
<<for _s to _len; _s gt 0; _s-->>
<<set _r to Math.floor(Math.random() * (_s + 1))>>
<<set _tmp to _shuffled[_s]>>
<<set _shuffled[_s] to _shuffled[_r]>>
<<set _shuffled[_r] to _tmp>>
<</for>>
/* Pick between 4 and 6 items (or fewer if inventory is small) */
<<set _displayCount to Math.min(_shuffled.length, Math.floor(Math.random() * 3) + 4)>>
<<set $pillforgDisplayed to _shuffled.slice(0, _displayCount)>>
<</if>>
<div class="merchant-header">
<h2>The Mysterious Pill Forge</h2>
<p>The air hums with alchemical qi as colorful elixirs glow faintly within jade bottles.</p>
</div>
<<link "Return to Market" "Market">><<set $pe to 0>><<unset $pillforgDisplayed>><</link>>
You open your satchel to reveal your Spirit Stones: <strong><span class="gold-amount"><<print $gold>></span> Spirit Stones</strong>
<<nobr>>
<<if $purchase neq null>>
<p style="color: #4fc3f7; font-weight: bold; margin-top: 20px; text-align: center;">
<br>You have acquired <<print $purchase>>.
</p>
<<unset $purchase>>
<<unset $purchaseclass>>
<</if>>
<</nobr>>
<table class="merchant-table">
<thead>
<tr>
<th>Elixir Recipe Offerings</th>
<th style="width: 150px; text-align: center;">Price</th>
<th style="width: 100px; text-align: center;">Purchase</th>
</tr>
</thead>
<tbody>
<<for _i to 0; _i lt $pillforgDisplayed.length; _i++>>
<<set _item to $pillforgDisplayed[_i]>>
<tr>
<td>
<div class="item-name"><<print _i + 1>>. <<print _item.name + " Recipe">></div>
</td>
<td style="text-align: center; vertical-align: middle;">
<div class="item-price"><<print _item.merchantCost>> Spirit Stones</div>
</td>
<td style="text-align: center; vertical-align: middle;">
<<if _item.merchantCost gt $gold>>
<span class="not-enough">Not enough gold</span>
<<else>>
<<capture _item>>
<<link "Buy" "Market">>
<<set _found to false>>
<<set _index to -1>>
<<for _j to 0; _j lt $knownRecipes.length; _j++>>
<<if $knownRecipes[_j].name === _item.name>>
<<set _found to true>>
<<set _index to _j>>
<<break>>
<</if>>
<</for>>
<<if _found>>
<<set $knownRecipes[_index].quantity += 1>>
<<else>>
<<set _newRecipe to clone(_item)>>
<<set $knownRecipes.push(_newRecipe)>>
<</if>>
<<set $gold -= _item.merchantCost>>
<<set $purchase to _item.name>>
<<set $purchaseclass to _item.class>>
/* Remove from both display list and master inventory */
<<set $pillforgDisplayed.deleteAt(_i)>>
<<set $mysteriouspillforgePillRecipeInventory.delete(_item)>>
<</link>>
<</capture>>
<</if>>
</td>
</tr>
<</for>>
</tbody>
</table>
<</nobr>>
<<elseif $pe eq 11>>
<<nobr>>
<img src="images/Locations/HeavenlyEdgeArmory.webp" class="location-bg" style="width:80%; border: 1px solid #c5a059; border-radius: 0;">
You approach the Heavenly Edge Armory, where a stern forge master hammers spirit blades to razor perfection. The air crackles with fiery qi and the clash of enchanted steel
<div style="margin:20px 0; padding:15px; background:rgba(30,60,100,0.5); border:2px solid #ffd700; border-radius:10px;">
<br><<link "Go back" $passage>><<set $pe to 0>><</link>>
<br><<link "Chat with the forge master">>
<<set _talk to true>>
<<replace "#chat-output">>The alchemist leans closer with a sly smile and says: <span class="male1">"<<print $thunderClapChat.random()>>"</span><</replace>><</link>>
<br><span id="chat-output"></span>
<br>
<br><<link "Browse weapons" "Market">><<set $pe to 12>><</link>>
</div>
<</nobr>>
<<elseif $pe eq 12>>
<div class="merchant-header">
<h2>Thunderclap Sword Forge</h2>
</div>
<<link "Return to Market" "Market">><<set $pe to 0>><</link>>
You open your satchel to reveal your Spirit Stones: <strong><span class="gold-amount"><<print $gold>></span> Spirit Stones</strong>
<<nobr>>
<<if $purchase neq null>>
<p style="color: #4fc3f7; font-weight: bold; margin-top: 20px; text-align: center;">
<br>You have acquired <<print $purchase>>.
</p>
<<unset $purchase>>
<<unset $purchaseclass>>
<</if>>
<</nobr>>
<table class="merchant-table">
<thead>
<tr>
<th>Weapons Offerings</th>
<th style="width: 150px; text-align: center;">Price</th>
<th style="width: 100px; text-align: center;">Purchase</th>
</tr>
</thead>
<tbody>
<<for _i to 0; _i lt $thunderclapswordforgeInventory.length; _i++>>
<<set _item to $thunderclapswordforgeInventory[_i]>>
<tr>
<td>
<div class="item-name"><<print _i + 1>>. <<print _item.name>></div>
<div class="item-desc"><<print _item.description>></div>
</td>
<td style="text-align: center; vertical-align: middle;">
<div class="item-price"><<print _item.price>> Spirit Stones</div>
</td>
<td style="text-align: center; vertical-align: middle;">
<<if _item.price gt $gold>>
<span class="not-enough">Not enough gold</span>
<<else>>
<<capture _item>>
<<link "Buy" "Market">>
<<set _found to false>>
<<set _index to -1>>
<<for _j to 0; _j lt $weaponInventory.length; _j++>>
<<if $weaponInventory[_j].name === _item.name>>
<<set _found to true>>
<<set _index to _j>>
<<break>>
<</if>>
<</for>>
<<if _found>>
<<set $weaponInventory[_index].quantity += 1>>
<<else>>
<<set _newItem to clone(_item)>>
<<set _newItem.quantity to 1>>
<<set $weaponInventory.push(_newItem)>>
<</if>>
/* Deduct gold and show purchase message */
<<set $gold -= _item.price>>
<<set $purchase to _item.name>>
<<set $purchaseclass to _item.class>>
<</link>>
<</capture>>
<</if>>
</td>
</tr>
<</for>>
</tbody>
</table>
<<elseif $pe eq 21>>
<<nobr>>
<img src="images/Locations/BlissFurnacePavilion.webp" class="location-bg" style="width:80%; border: 1px solid #c5a059; border-radius: 0;">
<br>You approach the Bliss Furnace Pavilion, where an eccentric alchemist brews elixirs of passion and desire. The air shimmers with intoxicating fumes and whispers of hidden pleasures.
<div style="margin:20px 0; padding:15px; background:rgba(30,60,100,0.5); border:2px solid #ffd700; border-radius:10px;">
<br><<link "Go back" $passage>><<set $pe to 0>><</link>>
<br><<link "Chat with the alchemist">>
<<set _talk to true>>
<<replace "#chat-output">>The alchemist leans closer with a sly smile and says: <span class="male1">"<<print $blissFurnaceChat.random()>>"</span><</replace>><</link>>
<br><span id="chat-output"></span>
<br>
<br><<link "Browse elixirs" "Market">><<set $pe to 22>><</link>>
<br><<if $gold gte 250>><<link "Yin-Yang Harmony Massage" "Market">><<set $pe to 23>><<set $gold -= 250>><</link>><<else>>Not enough Spirit Stones for Massage <</if>>
<br><<link "Personalized Jade Artifact Fitting" "Market">><<set $pe to 28>><</link>>
</div>
<</nobr>>
<<elseif $pe eq 22>>
<div class="merchant-header">
<h2>Bliss Furnace Pavilion</h2>
</div>
<<nobr>>
<br><<link "Return to Market" "Market">><<set $pe to 0>><</link>>
<br>You open your satchel to reveal your Spirit Stones: <strong><span class="gold-amount"><<print $gold>></span> Spirit Stones</strong>
<<if $purchase neq null>>
<p style="color:#ff69b4; font-weight:bold; text-align:center; margin:20px 0;">
You have acquired <<print $purchase>>.
</p>
<<unset $purchase>>
<</if>>
<</nobr>>
<<nobr>>
<table class="merchant-table">
<thead>
<tr>
<th>Offering</th>
<th style="width:180px;">Description</th>
<th style="width:120px;">Price</th>
<th style="width:100px;">Purchase</th>
</tr>
</thead>
<tbody>
<<for _i to 0; _i lt $blissfurnacepavilionInventory.length; _i++>>
<<set _item to $blissfurnacepavilionInventory[_i]>>
<tr>
<td>
<div class="item-name"><<print _i + 1>>. <<print _item.name>></div>
<<if _item.lewd neq null and _item.lewd>>
<span style="color:#ff69b4; font-size:0.9em;">(Secret Refinement Tool)</span>
<</if>>
</td>
<td><div class="item-desc"><<print _item.description>></div></td>
<td style="text-align:center; vertical-align:middle;">
<span class="item-price"><<print _item.price>> Stones</span>
</td>
<td style="text-align:center; vertical-align:middle;">
<<if _item.price gt $gold>>
<span style="color:#ff4444;">Not enough</span>
<<else>>
<<capture _item>>
<<link "Buy" "Market">>
<<set $gold -= _item.price>>
<<set $purchase to _item.name>>
/* Add to correct inventory */
<<if _item.class is "potion" or _item.class is "consumable">>
<!-- Potions/Consumables -->
<<set _found to false>>
<<for _j range $playerpotioninventory>>
<<if _j.name is _item.name>>
<<set _j.quantity += 1>>
<<set _found to true>>
<<break>>
<</if>>
<</for>>
<<if not _found>>
<<set _new to clone(_item)>>
<<set _new.quantity to 1>>
<<set $playerpotioninventory.push(_new)>>
<</if>>
<<else>>
<!-- Toys/Items (non-consumable) -->
<<set _found to false>>
<<for _j range $playeriteminventory>>
<<if _j.id is _item.id>>
<<set _found to true>>
<<break>>
<</if>>
<</for>>
<<if not _found>>
<<set $playeriteminventory.push(clone(_item))>>
<</if>>
<</if>>
<</link>>
<</capture>>
<</if>>
</td>
</tr>
<</for>>
</tbody>
</table>
<</nobr>>
<<elseif $pe eq 23>>
<<set _meiLingPresent to random(100) gte 50>> /* 50% chance she's absent */
<p>You recline on a heated jade table as Phoenix Tears Oil warms your skin, unblocking meridians...</p>
<<if _meiLingPresent>>
<<goto "Market">><<set $pe to 24>>
<<else>>
<<goto "Market">><<set $pe to 25>>
<</if>>
<<elseif $pe eq 24>>
Mei Ling expertly massages your body, her hands skilled in the art of yin-yang harmony. You feel waves of pleasure and relaxation wash over you as she works her magic.
<<link "Finish the massage" "Market">><<set $pe to 0>><</link>>
<<elseif $pe eq 25>>
<<nobr>>
Lian Feng, a young alchemist , bows deeply: <span class="male1">"Mei Ling rests from qi deviation, honored guest. I shall serve with utmost care."</span>
<p>You lie face-down on the warm jade table, silk towel draped loosely over your hips. The chamber smells of sweet incense and heated oil. Lian Feng stands at your side, pouring Phoenix Tears Oil into his palms.</p>
<p><span class="male1">"Long day of cultivation?"</span> he asks, voice low and steady. <span class="male1">"Your shoulders are knotted tight. Just relax... I'll work it out."</span></p>
<p>His hands land firm on your upper back - strong, callused thumbs digging into tense muscles. The oil is hot, sinking deep. You let out a soft sigh without meaning to.</p>
<p>He pauses for a second. <span class="male1">"There... feel that? Qi starting to move already."</span></p>
<<linkreplace "Murmur 'That feels good'">>
<p><span class="player">"That feels good,"</span> you say softly.</p>
<p>He chuckles quietly. <span class="male1">"Glad to hear it. Let's keep the flow steady."</span></p>
<p>His hands stay focused - long strokes down your spine, pressing along arms and legs. No wandering. Just pure relief as blocked meridians open.</p>
<div class="success-alert">+50 EXP | Full Qi restored </div>
<br><<gainExp 40 70>>
<<set $energy to $maxenergy>>
<br><<link "Thank him and leave" "Market">><<set $pe to 0>><</link>>
<br><<link "Stay quiet and breathe" "Market">><<set $pe to 26>><</link>><br>
<</linkreplace>>
<</nobr>>
<<elseif $pe eq 26>>
<<nobr>>
<p>You stay quiet, letting your breathing deepen. Lian Feng’s hands slow, becoming more deliberate. His palms slide lower, thumbs brushing the sides of your breasts with each pass.</p>
<p><span class="male1">"Skin like silk,"</span> he mutters, almost to himself. One hand drifts to your ribcage, fingers grazing the soft swell underneath.</p>
<p>Your breath catches - a tiny shiver runs through you. He feels it.</p>
<p><span class="male1">"Sensitive here, huh?"</span> His voice is rougher now, closer to your ear. <span class="male1">"The oil brings everything to the surface."</span></p>
<<set _massageChoice to null>> /* Temporary variable for this decision */
<div id="massage-choices">
<<if $corruption gte 10>>
<<link "Let him continue...">>
<<replace "#massage-choices">>
<p>His confidence grows. The towel slides lower as he works your hips - fingers slipping under the edge, kneading the top of your ass. A low groan escapes you.</p>
<p><span class="male1">"Fuck... you're soaked already,"</span> he whispers, surprised. His palm cups one cheek fully now, squeezing slow. The other hand glides up your side, thumb brushing your nipple as it hardens.</p>
<p><span class="male1">"Tell me to stop if you want,"</span> he says, voice thick, <span class="male1">"but your body's saying something else."</span></p>
<img src="images/Sex/massage.webp" class=center width=600>
<p>Heat pools between your legs.</p>
<p><span class="male1">"Beautiful,"</span> he breathes. One hand spreads your thighs wide; the other traces your folds - finding you already wet.</p>
<div id="massage-choices1">
<<link "That's enough!">><<set $pe to 0>>
<<replace "#massage-choices1">>
<p>You grab his wrist. <span class="player">"That's enough."</span></p>
<p>He stops instantly, breathing hard. <span class="male1">"My apologies."</span> Session ends respectfully.</p>
<div class="success-alert">+70 EXP</div>
<br><<gainExp 40 70>>
<<link "Leave">><<goto "Market">><<if $corruption lt 27>><<set $corruption += 1>><</if>><<set $sexFame += random(2,4)>><<set $pe to 0>><</link>>
<</replace>>
<</link>>
<<if $corruption gte 25>><<link "Let him continue" "Market">><<set $pe to 27>><</link>><</if>>
</div>
<</replace>>
<</link>>
<<link "Protest now">>
<<replace "#massage-choices">>
<p>You shift slightly. <span class="player">"Lian Feng... stick to the meridians."</span></p>
<p>He pulls back at once, clearing his throat. <span class="male1">"Right. My mistake."</span> Hands return to safe territory - firm, professional strokes only.</p>
<br><<gainExp 40 70>>
<<link "Finish up" "Market">><<set $pe to 0>><<if $corruption lt 30>><<set $corruption += 1>><</if>><<set $sexFame += random(2,4)>><</link>>
<</replace>>
<</link>>
<<else>>
<<replace "#massage-choices">>
<p>You tense and speak firmly. <span class="player">"Lian Feng... stick to the meridians."</span></p>
<p>He withdraws immediately. <span class="male1">"Of course. Forgive me."</span> The rest of the massage stays strictly professional.</p>
<br><<gainExp 40 70>>
<<link "Finish up" "Market">><<set $pe to 0>><<if $corruption lt 30>><<set $corruption += 1>><</if>><<set $sexFame += random(2,4)>><</link>>
<</replace>>
<</if>>
</div>
<</nobr>>
<<elseif $pe eq 27>>
<<nobr>>
<p>His fingers slide inside you - slow at first, then deeper, curling just right. You gasp as he adds a second, stretching you.</p>
<img src="images/Sex/massage1.webp" class="nsfw-glow">
<p><span class="male1">"Fuck, you're tight,"</span> he groans. Thumb circles your clit while his fingers pump steadily. Your hips buck; wetness coats his hand.</p>
<p>He flips you back over, ass in the air. Strong hands grip your cheeks, spreading you open as three fingers thrust deep from behind.</p>
<img src="images/Sex/massage2.webp" class="nsfw-glow">
<p>You moan into the table, pushing back against his hand. He growls, <span class="male1">"You want more, don't you?"</span></p>
<div id="massage-choices">
<<if $corruption gte 30>>
<<link "Let him continue...">>
<<replace "#massage-choices">>
<p>Lian Feng can't hold back anymore. He sheds his robe - cock thick and hard, dripping at the tip. He lines up behind you, rubbing against your soaked entrance.</p>
<p><span class="male1">"Need to be inside you,"</span> he says roughly, pushing in slow. You cry out as he stretches you completely.</p>
<img src="images/Sex/massage3.webp" width="60%" class="nsfw-glow">
<p>He starts thrusting - deep, steady strokes that make the table creak. Hands grip your hips hard, pulling you back onto him with every slam.</p>
<p><span class="male1">"So fucking good,"</span> he groans. Pace turns brutal - skin slapping, oil flying. You push back desperately, taking him deeper.</p>
<p>Pleasure builds fast. You come hard, walls clenching around him. He follows with a roar, burying deep and filling you with hot pulses.</p>
<p>Qi explodes between you - pure yang flooding yin in perfect harmony.</p>
<div class="success-alert" style="color:#ff4500;">
+80 EXP
</div>
<br><<gainExp 60 100>>
<<if $corruption lt 50>><<set $corruption += 2>><<set $sexFame += random(2,4)>><</if>>
<<link "Collapse spent">><<goto "Market">><<if $virginity eq 1>><<set $virginity = 0>><<set $virginityLost = "Masseur">><<set $sexFame += random(2,4)>><</if>><<set $pe to 0>><<set $humanSexCount += 1>><</link>>
<</replace>>
<</link>>
<</if>>
<<link "Protest now">>
<<replace "#massage-choices">>
<p>You shake your head. <span class="player">"Stop... please."</span></p>
<p>He pulls out slowly, breathing ragged. <span class="male1">"As you wish."</span> Massage ends here.</p>
<br><<gainExp 40 70>>
<<link "Leave flushed">><<goto "Market">><<set $pe to 0>><<set $sexFame += random(2,4)>><<if $corruption lt 37>><<set $corruption += 1>><</if>><</link>>
<</replace>>
<</link>>
</div>
<</nobr>>
<<elseif $pe eq 28>>
<<nobr>>
<<if $corruption lt 15>>
<p>The alchemist leads you to a silk-draped side chamber lined with polished jade artifacts of various shapes and sizes.</p>
<p><span class="male1">"These are personalized meridian probes,"</span> he explain calmly. <span class="male1">"Crafted to fit your body's unique qi flow. They help relieve stress, unblock stagnant meridians, and refine yin essence in private cultivation."</span></p>
<p><span class="male1">"Many disciples use them for solo refinement. Nothing shameful - merely a tool for progress."</span></p>
<p>You nod, understanding the purpose, but feel a faint warmth in your cheeks. The idea is... intriguing, yet you are not quite ready to indulge.</p>
<p><i>(Requires Corruption 15+ to proceed with fitting)</i></p>
<br><<link "Go back" "Market">><<set $pe to 0>><</link>>
<<else>>
<p>The alchemist guides you behind heavy silk curtains into a warmly lit fitting chamber. Dozens of jade artifacts gleam on velvet cushions - smooth rods, tapered plugs, beaded chains, all pulsing faintly with contained qi.</p>
<p><span class="male1">"Welcome to true personalization,"</span> he say with a knowing smile. <span class="male1">"We will measure your meridians and craft a probe perfectly suited to your body. It will become your most intimate cultivation tool."</span></p>
<p>You feel heat rising - not from embarrassment, but anticipation. Your corruption has awakened curiosity you can no longer deny.</p>
<<link "Return to Pavilion">><<goto "Market">><<set $pe to 0>><</link>>
<h3 style="color:#ff69b4; margin:30px 0 20px;">Choose Your Artifact Type</h3>
<<set _customfittingblissfurnaceinventory to []>>
<<set _customfittingblissfurnaceinventory.push($jadeprobe, $phoenixfeatherplug, $lotusbeads
)>>
<div style="display:grid; grid-template-columns:1fr 1fr; gap:25px; margin-bottom:30px;">
<<for _i to 0; _i lt _customfittingblissfurnaceinventory.length; _i++>>
<<set _item to _customfittingblissfurnaceinventory[_i]>>
<tr>
<td>
<div class="item-name"><<print _i + 1>>. <<print _item.name>></div>
<div class="item-desc"><<print _item.description>></div>
<span style="color:#ff1493; font-size:0.9em;">(Private Yin Refinement Tool)</span>
</td>
<td style="text-align:center;">
<<print 350>> Stones<br>
<span style="font-size:0.9em; color:#ff69b4;">+ Personal Fitting</span>
</td>
<td style="text-align:center;">
<<if $gold lt 350>>
<span style="color:#ff4444;">Not enough</span>
<<elseif $corruption lt 15>>
<span style="color:#ff69b4;">(Corruption 15+ required)</span>
<<else>>
<<capture _item>>
<<link "Purchase & Fit">>
<<set _found to false>>
<<set _index to -1>>
<<for _j to 0; _j lt $playeriteminventory.length; _j++>>
<<if $playeriteminventory[_j].name === _item.name>>
<<set _found to true>>
<<set _index to _j>>
<<break>>
<</if>>
<</for>>
<<if _found>>
<<set $playeriteminventory[_index].quantity += 1>>
<<else>>
<<set _newItem to clone(_item)>>
<<set _newItem.quantity to 1>>
<<set $playeriteminventory.push(_newItem)>>
<</if>>
/* Deduct gold and show purchase message */
<<set $gold -= 350>>
<<set $purchase to _item.name>>
<<set $purchaseclass to _item.class>>
<<goto "Market">><<set $pe to 29>>
<</link>>
<</capture>>
<</if>>
</td>
</tr>
<</for>>
<</if>>
<</nobr>>
<<elseif $pe eq 29>>
<<nobr>>
<p><span class="male1">"Now... let us ensure perfect fit."</span></p>
<p>The alchemist closes the silk curtain behind you, sealing the chamber in warm, dim light scented with aphrodisiac incense.</p>
<p><span class="male1">"For true personalization,"</span> he say in a low, professional tone, <span class="male1">"we must first measure your body's natural response. Lie back on the jade table and relax."</span></p>
<p>You recline as instructed. The cool stone against your bare back sends a shiver through you. The alchemist gently lifts your knees and spreads your legs wide, exposing you completely to their calm, practiced gaze.</p>
<img src="images/Sex/toyfitting.webp" class="nsfw-glow">
<p>Strong hands hold your thighs open as they lean in close, studying every intimate detail with clinical focus that gradually turns heated.</p>
<p><span class="male1">"Beautiful structure,"</span> he murmur, voice dropping. <span class="male1">"Petals flushed and already glistening. Your yin gate responds eagerly to exposure."</span></p>
<p>A gloved finger traces your outer lips lightly, parting them to reveal the slick pink within. You bite your lip as cool air meets wet heat.</p>
<p><span class="male1">"Sensitive here,"</span> he note, brushing your swollen clit once - just enough to make your hips twitch. <span class="male1">"And here..."</span> Two fingers spread you wider, opening your entrance fully to inspection.</p>
<p>He press gently at your hole, testing resistance. <span class="male1">"Tight, yet yielding. Perfect depth for deep refinement. You will take a full probe easily."</span></p>
<p>Another slow circle around your clit, deliberate now. <span class="male1">"Natural lubrication abundant. Your body is ready for pleasure cultivation."</span></p>
<p>Finally, he withdraws, eyes dark with restrained hunger. <span class="male1">"Measurements complete. Your meridians sing with need."</span></p>
<<set $corruption += random(2,3)>>
<<set _lastToy to $purchase>> <!-- Uses the name from purchase -->
<<linkappend "The alchemist presents your custom <<print $purchase>>">>
- perfectly matched to your depth and girth preference.
<<if _lastToy eq "Jade Meridian Probe">>
<p><span class="male1">"Use it freely in private. It will bring powerful yin refinement... and pleasure."</span></p>
<<elseif _lastToy eq "Phoenix Feather Anal Plug">>
<p><span class="male1">"This one will awaken your rear meridians,"</span> he murmurs. <span class="male1">"Breathe slow and push back when you feel pressure."</span></p>
<p>You feel the cool tip press against your tight ring. A steady, gentle push follows - the jade slides in smoothly, stretching you open inch by inch until the widest part pops past the resistance and seats deep inside.</p>
<p>Warm yang fire instantly spreads through forbidden channels. The soft feathers brush your sensitive skin with every tiny movement, sending shivers up your spine.</p>
<p><span class="male1">"Perfect fit,"</span> he praises, giving the base a light tug that makes you gasp. <span class="male1">"Your body accepts it greedily."</span></p>
<<elseif _lastToy eq "Lotus Prayer Beads">>
<p>The alchemist lays out the string of graduated rose quartz beads, each one larger than the last, polished to a silky sheen.</p>
<p><span class="male1">"We insert them one by one,"</span> He explains softly. <span class="male1">"Feel each bead stretch and settle before the next."</span></p>
<p>Cool oil drips between your cheeks. The smallest bead presses in easily - then the next, larger one forces a soft moan from your lips as it stretches your ring wider.</p>
<p>One after another they disappear inside you, each pop sending a pulse of yin qi through your body. By the time the largest bead seats deep, you feel deliciously full, every slight shift tugging at sensitive nerves.</p>
<p>The alchemist gives the loop at the end a gentle pull - the beads shift inside, making your hips buck involuntarily.</p>
<p><span class="male1">"Exquisite response,"</span> he whispers. <span class="male1">"Your meridians are wide open now."</span></p>
<</if>>
<p>You acquired: _lastToy</p>
<<link "Return to Pavilion">><<goto "Market">><<set $pe to 0>><</link>>
<</linkappend>>
<</nobr>>
<<elseif $pe eq 30>>
<<set $corruption += random(2,3)>>
<<linkappend "The alchemist carefully coats the tapered jade plug.">>
<p><span class="male1">"This one will awaken your rear meridians,"</span> they murmur. <span class="male1">"Breathe slow and push back when you feel pressure."</span></p>
<p>You feel the cool tip press against your tight ring. A steady, gentle push follows - the jade slides in smoothly, stretching you open inch by inch until the widest part pops past the resistance and seats deep inside.</p>
<p>Warm yang fire instantly spreads through forbidden channels. The soft feathers brush your sensitive skin with every tiny movement, sending shivers up your spine.</p>
<p><span class="male1">"Perfect fit,"</span> they praise, giving the base a light tug that makes you gasp. <span class="male1">"Your body accepts it greedily."</span></p>
<p>You acquired: Phoenix Feather Anal Plug<br></p>
<<link "Return to Pavilion">><<goto "Market">><<set $pe to 0>><</link>>
<</linkappend>>
<<elseif $pe eq 31>>
<<set $corruption += random(2,3)>>
<<linkappend "The alchemist lays out the string of graduated rose quartz beads">>, each one larger than the last, polished to a silky sheen.
<p><span class="male1">"We insert them one by one,"</span> they explain softly. <span class="male1">"Feel each bead stretch and settle before the next."</span></p>
<p>Cool oil drips between your cheeks. The smallest bead presses in easily - then the next, larger one forces a soft moan from your lips as it stretches your ring wider.</p>
<p>One after another they disappear inside you, each pop sending a pulse of yin qi through your body. By the time the largest bead seats deep, you feel deliciously full, every slight shift tugging at sensitive nerves.</p>
<p>The alchemist gives the loop at the end a gentle pull - the beads shift inside, making your hips buck involuntarily.</p>
<p><span class="male1">"Exquisite response,"</span> they whisper. <span class="male1">"Your meridians are wide open now."</span></p>
<p>You acquired: Lotus Prayer Beads<br></p>
<<link "Return to Pavilion">><<goto "Market">><<set $pe to 0>><</link>>
<</linkappend>>
<</if>><<if $pe eq 0>>
<img src="images/Locations/BathHouse.jpg" class="location-bg" style="width:80%; border: 1px solid #c5a059; border-radius: 0;">
You step beneath the curved archway of the bathhouse, where steam curls lazily from the open roof. The scent of lotus flowers and mineral-rich springs wafts through the air, blending with the warm aroma of aged wood and faint medicinal herbs.
A delicate chime rings above the entrance as you push aside the bamboo curtain. Inside, soft light glows from spirit stones embedded in the walls, casting gentle reflections on the polished stone floor.
<<set _random to random(0,1)>>\
<<if _random eq 0>>\
Behind a low counter sits a slender woman in light crimson robes, a jade ornament pinned to her hair. Her eyes lift to meet yours—measured, slightly amused, and unmistakably aware of your gaze.
<span class="female">"Welcome to the Moonveil Springs, traveler. You look like you’ve carried dust and spirit strain from the road... or a fight."</span>
She gestures toward a lacquered board displaying prices written in flowing calligraphy.
<span class="female">"Private pool: ten spirit stones. Communal bath: three."</span>
<<else>>\
Behind a low wooden counter sits a man in dark, well-fitted robes. His sleeves are loosely rolled up, revealing calloused forearms marked with faint spirit script. A single strand of black hair falls across his sharp eyes as he regards you—calm, calculating, with the faintest hint of a smirk tugging at his lips.
<span class="male">"You’ve got the look of someone who’s fought more than just beasts today."</span>
He leans forward slightly, voice smooth like aged wine.
<span class="male">"Communal bath is three spirit stones. Private spring’s ten."</span>
<</if>>
<<link "Go back" $passage>><<set $pe to 0>><</link>>
<<linkappend "Private Bath">>
<<if $gold gte 10>><<goto "Public Baths">>
<<set $pe to 1>>
<<set $gold -=10>>
<<else>>You don't have enough spirit stones!<</if>>
<</linkappend>>
<<linkappend "Communal bath">>
<<if $corruption gt 10 and $gold gte 3>><<goto "Public Baths">><<set $pe=10>><<elseif $corruption gt 10 and $gold lt 3>>You don't have enough spirit stones!<<elseif $corruption lte 10>><span class="player">What am I even thinking?</span><</if>>
<</linkappend>>
<<elseif $pe eq 1>>
The attendant leads you to a side corridor and slides open a paper door carved with phoenix patterns.
Inside, the private spring glows faintly from embedded spirit stones. Mist curls around the edges of the stone pool like spirit snakes. The scent of plum blossoms and sandalwood fills the air.
<<linkappend "You’re finally alone.">>
You step onto the smooth stone floor beside the steaming water. The silence is calming. Your fingers trace the knot of the towel at your hip.
<span id="choice1">
<<linkreplace "Gently lower yourself into the water, towel still on.">>
<<replace "#choice2">><</replace>>
<div style="position: relative; width: 70%; height: auto;">
<img src="images/Background/publicbath.jpg" style="width: 100%; display: block;">
<img src="images/Sex/bath.png" style="width: 100%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">
</div>
You let the warmth soak through the cloth, your body relaxing slowly. The towel floats faintly around you, growing more transparent with every second. A quiet moment of solitude. You close your eyes and breathe in deep.
<span class="healthy">You've recovered part of your health and qi.</span>
<<if $health lt $maxhealth or $energy lt $maxenergy>><<set $health to ($health += $health*0.1)>> <<set $energy to ($energy += $energy*0.1)>><<if $health gte $maxhealth>><<set $health to $maxhealth>><</if>><<if $energy gte $maxenergy>><<set $energy to $maxenergy>><</if>><</if>>
<<link "Finish bathing" "Public Baths">><<set $pe to 0>><</link>>
<</linkreplace>>\
</span>\
\
<span id="choice2">
<<linkreplace "Remove the towel, letting it fall before entering naked.">>\
<<replace "#choice1">><</replace>>\
<div style="position: relative; width: 70%; height: auto;">
<img src="images/Background/publicbath.jpg" style="width: 100%; display: block;"><<set _random=random(0,1)>><<if _random eq 0>>
<img src="images/Sex/nakedbath.png" style="width: 100%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);"><<else>><img src="images/Sex/nakedbath1.png" style="width: 100%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);"><</if>>
</div>
With a flick of your fingers, the towel slides down your body and falls silently to the floor. The air brushes your bare skin, and the rising steam embraces you like a lover’s breath.
You step into the water, feeling the heat soak into every part of you. Free. At peace.
You settle against the smooth stone edge, letting your arms drape lazily over the rim. Steam clings to your skin in droplets, tracing paths down the gentle curves of your breasts, the dip of your stomach, the soft flesh between your thighs.
<span class="healthy">You've recovered part of your health and qi.</span>
<<link "Finish bathing" "Public Baths">><<set $pe to 0>><</link>>
<<if $health lt $maxhealth or $energy lt $maxenergy>><<set $health to ($health += $health*0.1)>> <<set $energy to ($energy += $energy*0.1)>><<if $health gte $maxhealth>><<set $health to $maxhealth>><</if>><<if $energy gte $maxenergy>><<set $energy to $maxenergy>><</if>><</if>>
<<linkappend "You feel a slow, warm ache between your thighs...">>
<div style="position: relative; width: 70%; height: auto;">
<img src="images/Background/publicbath.jpg" style="width: 100%; display: block;"><<set _random=random(0,1)>>
<img src="images/Sex/masturbation_bath.png" style="width: 100%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">
</div>
Your fingers drift underwater, trailing along your inner thigh. There’s no one here.
Your hand slides between your legs, parting the folds of your pussy with practiced ease. The water only amplifies the sensation—heat kissing your skin, your clit pulsing softly under your touch.
You circle it slowly, teasing yourself with delicate strokes. Pleasure flutters through your core, subtle at first… but growing. You tilt your head back, lips parting with a quiet sigh as you press in deeper.
Two fingers slip past your entrance, spreading your slick folds beneath the surface. You curl them slightly inside yourself, your breath catching as you hit just the right spot. The soft slap of water echoes faintly with every motion of your hips. The rhythm builds—slow, wet, steady.
Your free hand cups your breast, thumb brushing across a hardened nipple. You moan this time—quiet but unashamed. The sound disappears into the steam, claimed by the silence of the room.
Each thrust of your fingers drives the heat higher. Your clit throbs beneath your touch, swollen and needy, aching for release. You rub it faster now, your thighs tensing around your hand.
Pressure coils inside you—tight, hot, irresistible. The peak rushes toward you like qi flooding a meridian.
And then—
You come with a soft cry, legs trembling in the water, pleasure tearing through you like a quiet storm. Your back arches, your walls clenching greedily around your fingers as wave after wave crashes through your body.
You collapse back against the stone, chest rising and falling, fingers still lazily nestled between your thighs.
The water calms again, rippling gently as if it too is catching its breath.
<<link "Finish bathing" "Public Baths">><<set $pe to 0>><<if $corruption lt 15>><<set $corruption +=1>><</if>><</link>>
<</linkappend>>
<</linkreplace>>\
</span>\
<</linkappend>>
<<elseif $pe eq 10>>
You step into the steamy chamber of the communal bath. The room is filled with the soft murmur of voices, the splash of water, and the scent of heated minerals.
Smooth stone tiles line the hot spring pool, its edges decorated with dragon-shaped spouts that pour steaming water into the crystal-clear basin. A handful of cultivators lounge in the pool—some meditating in silence, others casually conversing in hushed tones.
You feel the warmth wrap around your body through the thin bath towel provided. Moisture clings to your skin already, making it stick slightly. A few glances are thrown your way, subtle and brief… though one lingers.
You approach the water’s edge.
<span id="choice1">
<<linkreplace "Keep the towel on and slide into the water.">>
<<replace "#choice2">><</replace>>
<div style="position: relative; width: 70%; height: auto;">
<img src="images/Background/publicbath.jpg" style="width: 100%; display: block;">
<img src="images/Sex/bath.png" style="width: 100%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">
</div>
You sink into the warmth slowly, the towel still clinging loosely to your body. It becomes translucent as it soaks, and you catch more than one curious glance from the others. Whether it's respect or something else, it's hard to tell in the rising steam.
<span class="healthy">You've recovered part of your health and qi.</span>
<<if $health lt $maxhealth or $energy lt $maxenergy>><<set $health to ($health += $health*0.1)>> <<set $energy to ($energy += $energy*0.1)>><<if $health gte $maxhealth>><<set $health to $maxhealth>><</if>><<if $energy gte $maxenergy>><<set $energy to $maxenergy>><</if>><</if>>
<<link "Finish bathing" "Public Baths">><<set $pe to 0>><<if $corruption lt 25>><<set $corruption +=1>><</if>><</link>>
<</linkreplace>>\
</span>\
\
<span id="choice2">
<<linkreplace "Let the towel fall and step in naked.">>\
<<replace "#choice1">><</replace>>\
<div style="position: relative; width: 70%; height: auto;">
<img src="images/Background/publicbath.jpg" style="width: 100%; display: block;"><<set _random=random(0,1)>><<if _random eq 0>>
<img src="images/Sex/nakedbath.png" style="width: 100%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);"><<else>><img src="images/Sex/nakedbath1.png" style="width: 100%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);"><</if>>
</div>
You untie the towel and let it drop to the smooth stone without hesitation. The steam caresses your bare skin as you step confidently into the water. A nearby cultivator—one with a jade pin in her hair—lets her eyes flick to you briefly, then back again.
<span class="female">"Brave or bold,"</span> she murmurs to herself, just loud enough for you to hear.
You settle into the warm waters, letting the steam and heat melt away tension from your limbs. The crystalline surface ripples as you stretch, utterly bare beneath the rising mist. Around you, soft conversations drift in and out like incense smoke, but your mind floats in calm silence.
<span class="healthy">You've recovered part of your health and qi.</span>
<<set _chance = random(0,100)>>
<<if _chance lte 99>>
Until someone joins you.
<img src="images/Sex/bathev.webp" style="width: 100%">
The water shifts subtly. A figure enters the pool on your left—tall, well-built, his bare torso still glistening from the mist. His face is unfamiliar, but his gaze lingers just a little too long on your body before he speaks.
<span class="male">"Didn’t think I’d find someone so bold in a place like this,"</span>he says, voice smooth like oiled silk, with a smirk that suggests he's no stranger to indulgence.
<span class="male">"Not every day you see someone that comfortable in their skin... but I like it."</span>
He leans in slightly, not close enough to touch, but close enough to make his presence feel intentional.
His tone lowers, just enough to make it feel <i>sensual</i>.
<span class="male">"You look like someone who knows how to... ease tension. How about lending a hand? I’ll make it worth your while."</span>
He shifts beneath the water slightly. From the faint ripples—and the way his eyes lock on yours—you know exactly what he means.
<div id="choice3">
<<if $corruption gt 25>><<link "Accept his offer and reach beneath the water.">>
<<replace "#choice3">>
<<set _randomHJ =random(0,3)>>
<div style="position: relative; width: 70%; height: auto;">
<img src="images/Background/publicbath.jpg" style="width: 100%; display: block;"><<set _random=random(0,1)>><<if _randomHJ eq 0>>
<img src="images/Sex/handjob_bath.png" style="width: 100%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);"><<elseif _randomHJ eq 1>><img src="images/Sex/handjob_bath1.png" style="width: 100%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);"><<elseif _randomHJ eq 2>><img src="images/Sex/handjob_bath2.png" style="width: 100%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);"><<elseif _randomHJ eq 3>><img src="images/Sex/handjob_bath3.png" style="width: 100%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);"><</if>>
</div>
The water around you shifts as you scoot a little closer, letting your knee brush against his beneath the surface. His smirk fades, replaced with a breathless stillness as he watches your hand disappear beneath the steaming surface.
Your fingers glide across the warmth of his thigh—firm, tense—before you wrap them slowly around his cock. Hard. Hot. Already twitching with need beneath the water.
He exhales sharply. <span class="male">“Fuck…”</span>
The sound of it, ragged and low, makes heat coil in your belly.
You stroke him slowly at first, your movements masked by the gentle ripples of the bathwater.
His head tips back slightly, jaw tight, chest rising with sharp breaths.
<span class="male">"Shit—gods, your hand…"</span> he mutters, voice hoarse. <span class="male">"You're better than half the courtesans in Golden Silk Pavilion..."</span>
You smirk, your fingers tightening just slightly, giving him a slow, deliberate pump that earns a low groan from his throat.
Around you, the bathhouse continues—unaware or uncaring of what’s happening just beneath the surface. Maybe someone knows. Maybe they’re watching.
He shifts closer, one hand gripping the edge of the stone, muscles taut.
<span class="male">“Fuck—don’t stop. Just like that...”</span>
Your strokes grow faster, firmer. His cock throbs in your hand, slick now from a mix of precum and water, and you feel him twitch violently as his breath grows uneven.
<span class="male">"I'm gonna—fuck—"</span>
He jerks forward just slightly, and with a soft grunt, he spills into the water—hot spurts lost in the steam, his hips trembling beneath your hand.
You let go slowly, dragging your fingers up his length one last time before retracting your hand, watching the way his chest heaves and his lips part with dazed satisfaction.
He leans in, whispering with a lopsided grin.
<span class="male">“Remind me never to underestimate anyone in this bathhouse again.”</span>
<<link "Finish bathing" "Public Baths">><<set $pe to 0>><<set $sexFame += random(2,4)>><<if $corruption lt 35>><<set $corruption +=1>><</if>><</link>>
<</replace>><</link>><</if>>
<<if $corruption gt 10>><<link "Smirk but only tease him">>
<<replace "#choice3">>
You give him a slow look, deliberately trailing your gaze down his chest.
<span class="player">"You’ll have to try harder than that to earn a touch from me."</span>He chuckles, raising his hands in mock surrender.
<span class="male">"Fair enough. But I’m not giving up just yet."</span>
<<link "Finish bathing" "Public Baths">><<set $sexFame += 1>><<set $pe to 0>><<if $corruption lt 15>><<set $corruption +=1>><</if>><</link>>
<</replace>> <</link>><</if>>
<<link "Politely decline">>
<<replace "#choice3">>
You meet his eyes and offer a calm smile.
<span class="player">"I came here to relax, not to serve."</span>
He raises an eyebrow but nods, backing off without offense.
<span class="male">"Respect. Maybe another time, then."</span>
<<link "Finish bathing" "Public Baths">> <<set $pe to 0>> <</link>>
<</replace>><</link>>
</div>
<<else>>
No one interfered with your relax...
<<link "Finish bathing" "Public Baths">><<set $pe to 0>> <</link>>
<</if>>
<</linkreplace>>\
</span>\
\
\
\
<</if>><<set _currentpassage to passage()>>
<<print $PlayerLocation>>
<<if $pe eq 0>>
<br>The air is thick with the scent of spiritual wine and the low hum of cultivators discussing the Dao.
<br><<if $fame gt 50>>
The rowdy crowd settles as you enter. A few rogue cultivators nudge each other, whispering about your recent exploits.
<br><<else>>
No one looks up as you enter. To them, you are just another wandering soul seeking a moment's respite.
<</if>>
<hr>
<div id="gossip-area">
<<link "Buy a jar of wine and listen to gossip (5 Spirit Stones)">>
<<set $gold -= 5>>
<<set $energy += 5>>
<<replace "#gossip-area">>
<<TavernGossip>>
<</replace>>
<</link>>
</div>
<<set _roll to random(1, 100)>>
<<if _roll lte 15>>
/* Positive Outcome */
<p>A troupe of musicians plays a song of the ancient Sects. The harmonic resonance aligns your meridians.</p>
<span class="gold">You feel invigorated! (+10 Energy)</span>
<<set $energy += 10>>
<<elseif _roll lte 30>>
/* Interaction Outcome */
<p>A drunken brute slams his jug down. "You! Woman! You look like you can handle your liquor. Care to bet on a contest?"</p>
<<linkreplace "Accept the challenge">>
<<set _physique to random(1, 10)>>
<<if _physique + ($cultivationLevel) gt 8>>
<p>You drain the jug without blinking. The brute laughs and toasts to your name!</p>
<span class="green">Your fame spreads. (+5 Fame)</span>
<<set $fame += 5>>
<<else>>
<p>The spiritual wine is too potent. Your vision swims, and you collapse into a heap.</p>
<span class="red">How embarrassing. (-5 Energy, -2 Fame)</span>
<<set $energy -= 5>><<set $fame -= 2>>
<</if>>
<</linkreplace>>
<<elseif _roll lte 45>>
/* Trigger the Arrogant Young Master */
<p>The atmosphere suddenly chills. A young man in silk robes is berating a server. His eyes lock onto you with predatory interest.</p>
<<link "Approach the commotion" "Arrogant Young Master Tavern">><<set $pe to 0>><</link>>
<<else>>
<p>It is a quiet night. You find a corner to meditate and listen to the local gossip.</p>
<</if>>
<<GenerateEncounterBatch "tavern">>
<<DisplayEncounter>>
<hr>
<<link "Rest at a table (Cost: 5 Spirit Stones)" $passage>>
<<set $gold -= 5>><<set $energy += 20>>
<</link>>
<br><<link "Leave the tavern" $city>><<set $pe to 0>><</link>>
<</if>><h1 style="text-align:center; color:#d4af37; border-bottom: 2px ridge #d4af37;">Celestial Alchemy Cauldron</h1>
<p class="flavor-text">A faint hum of spiritual energy emanates from the bronze tripod. Ancient runes glow along the walls as you prepare your ingredients.</p>
<div id="craftlog"></div>
<<if $knownRecipes.length gt 0>>
<<nobr>>
/* State Management */
<<set $workshopPage to $workshopPage ?? 1>>
<<set $workshopFilter to $workshopFilter ?? "All">>
<<set _itemsPerPage to 5>>
/* 1. Gather Tags for Filters */
<<set _availableTags to ["All"]>>
<<for _recipe range $knownRecipes>>
/* Using your new 'tag' variable from the potion object */
<<set _tag to _recipe.result.tag ?? "Misc">>
<<if not _availableTags.includes(_tag)>>
<<run _availableTags.push(_tag)>>
<</if>>
<</for>>
/* 2. Filter Logic */
<<set _filteredRecipes to []>>
<<for _recipe range $knownRecipes>>
<<if $workshopFilter eq "All" or _recipe.result.tag eq $workshopFilter>>
<<run _filteredRecipes.push(_recipe)>>
<</if>>
<</for>>
/* 3. Pagination Math */
<<set _maxPage to Math.max(1, Math.ceil(_filteredRecipes.length / _itemsPerPage))>>
<<set _startIndex to ($workshopPage - 1) * _itemsPerPage>>
<<set _displayRecipes to _filteredRecipes.slice(_startIndex, _startIndex + _itemsPerPage)>>
/* 4. Filter UI */
<div class="filter-bar">
<span style="color:#8b7332; margin-right:10px;">◈ Category ◈</span>
<<for _tag range _availableTags>>
<<capture _tag>>
<<if $workshopFilter eq _tag>>
<span class="filter-link active-filter">_tag</span>
<<else>>
/* Fixed passage error by using 'goto' inside link */
<<link _tag>>
<<set $workshopFilter to _tag>>
<<set $workshopPage to 1>>
<<goto `passage()`>>
<</link>>
<</if>>
<</capture>>
<</for>>
</div>
/* 5. The Table */
<table class="alchemy-table">
<tr>
<th>Pill Name</th>
<th>Required Essence</th>
<th>Action</th>
</tr>
<<if _displayRecipes.length eq 0>>
<tr><td colspan="3" style="text-align:center;">No scrolls found in this category.</td></tr>
<<else>>
<<for _recipe range _displayRecipes>>
<<capture _recipe>>
<tr>
<td>
<span class="recipe-name"><<print _recipe.name>></span><br>
<span style="font-size: 0.85em; color: #aaa;"><i><<print _recipe.result.description>></i></span>
</td>
<td>
<<for _id, _qty range _recipe.ingredients>>
<<set _itemName to _id.replace(/([a-z])([A-Z])/g, "$1 $2").toUpperFirst()>>
<span class="ingredient-item" style="color:#a8d5a8;">
🌿 _qty x _itemName
</span><br>
<</for>>
</td>
<td style="text-align:center;">
<<link "Commence Refining">>
<<craftItem _recipe>>
<</link>>
</td>
</tr>
<</capture>>
<</for>>
<</if>>
</table>
/* 6. Pagination Controls */
<div style="text-align: center; margin-top: 20px; font-family: serif;">
<<if $workshopPage gt 1>>
<<link "🠔 Previous Scroll">>
<<set $workshopPage -= 1>>
<<goto `passage()`>>
<</link>>
<<else>>
<span style="color: #444;">🠔 Previous Scroll</span>
<</if>>
<span style="margin: 0 20px; color:#d4af37;">Page $workshopPage of _maxPage</span>
<<if $workshopPage lt _maxPage>>
<<link "Next Scroll 🠖">>
<<set $workshopPage += 1>>
<<goto `passage()`>>
<</link>>
<<else>>
<span style="color: #444;">Next Scroll 🠖</span>
<</if>>
</div>
<</nobr>>
<<else>>
<p>Your mind is empty of pill formulas. Seek out alchemical manuals before returning to the cauldron.</p>
<</if>>
<br>
<div style="text-align:center;">
<<link "Leave the Cauldron Room" $passage>>
<<unset $workshopPage, $workshopFilter>>
<</link>>
</div><img src="images/Locations/portal.jpg" class="location-bg" style="width:50%; border: 1px solid #c5a059; border-radius: 0;">
<<link "Go back" $passage>><</link>>
You're currently at $region
From this place you can use portal to:
<<set _destinations = [
{name:"Ghost King Netherworld Sect", region:"Ghost King Netherworld Sect", passage:"GhostKingNetherworldSect", x:9, y:12},
{name:"Clear Sky Azure Dragon Pavilion", region:"Clear Sky Azure Dragon Pavilion", passage:"ClearSkyAzureDragonPavilion", x:1, y:6},
{name:"Jade Creek Town", region:"Jade Creek Town", passage:"Jade Creek Town", x:2, y:12}
]>>
<p>You stand before a glowing portal. Where will you go?</p>
<<nobr>>
<<for _d range _destinations>>
<<if $region !== _d.region>>
<<if $gold >= 25>>
<li>
<<capture _d>>
<<link "Teleport to ">>
<<set $gold -= 25>>
<<set $region = _d.region>>
<<set $playerX = _d.x>>
<<set $playerY = _d.y>>
<<goto _d.passage>>
<</link>> (Cost: 25 gold) _d.name
<</capture>>
</li>
<<else>>
<li><span style="opacity:0.5">Teleport to [_d.name] (Not enough gold!)</span></li>
<</if>>
<<else>>
<li><span style="opacity:0.5">Already at [_d.name]</span></li>
<</if>>
<</for>>
<</nobr>>[[Go back->ClearSkyAzureDragonPavilion]]
<div class="sect-info">
<h2>Clear Sky Azure Dragon Pavilion</h2>
<p><b>Sect Purpose:</b> Defending humanity from demonic beasts.</p>
<p><b>Sect Rules:</b> Do not harm the innocent.</p>
<hr>
<p><b>Your Position:</b></p>
<<if $CurrentPcMainSect != "Azure Dragon Sect" and $CurrentPcMainSect != "Ghost King Netherworld Sect">>
<<link "Join the Sect">>
<<goto "Clear Sky Azure Dragon Pavilion Joining Scene">>
<</link>>
<<elseif $CurrentPcMainSect neq "Azure Dragon Sect">>
<ul>
<li><b>You're not part of this sect!</b></li>
</ul>
<<elseif $CurrentPcMainSect == "Azure Dragon Sect">>
<ul>
<li><b>Rank:</b> <<print $CurrentPcSectRank>></li>
<li><b>Reputation:</b> <<print $CurrentPcSectReputation>></li>
</ul>
<</if>>
</div><<if $pe eq 0>>
<<set $returnpassage to passage()>>
<<if $recommendationLetter eq "righteous">>
Variant 1: Player has a recommendation letter
You stand at the entrance of the Clear Sky Azure Dragon Pavilion, the sacred grounds of the sect stretching out before you. The towering structures of ancient stone and wood stand with an aura of power and wisdom. The sound of distant cultivation practices echoes across the courtyard as disciples train and meditate, their movements graceful and precise.
You take a deep breath, clutching the sealed recommendation letter you received earlier. The sect’s disciple eyes the letter, and a respectful nod follows.
“I see you’ve been vouched for. The Pavilion welcomes you.”
With that, he gestures toward the main building, allowing you to pass.
You have been accepted into the sect, your future now intertwined with the Azure Dragon Pavilion.
You may now begin your training and cultivate under their guidance.
<<link "Continue" "ClearSkyAzureDragonPavilion">>
<<set $CurrentPcSectRank to "Initiate">>
<<set $CurrentPcAffiliation to "Clear Sky Azure Dragon Pavilion">>
<<set $CurrentPcMainSect to "Azure Dragon Sect">>
<<set $CurrentPcSect to "righteous">>
<</link>>
<<else>>
You stand at the entrance of the Clear Sky Azure Dragon Pavilion, the sacred grounds of the sect stretching out before you. The towering structures of ancient stone and wood stand with an aura of power and wisdom. The sound of distant cultivation practices echoes across the courtyard as disciples train and meditate, their movements graceful and precise.
You approach the entrance, heart racing with excitement at the thought of joining such a prestigious sect. A disciple standing guard raises an eyebrow, looking you over.
“Do you have a recommendation letter from a sect member or higher authority?” Without one, I’m afraid we cannot allow entry into the sect at this time. The path to true cultivation requires both merit and connections. However you may try to enter through duel trial. You'll face one of the sect initiates. If you manage to win, you'll be accepted”
With no recommendation in hand, you feel your chances slipping away. However, the sect is vast, and there may still be a way for you to prove yourself. The choice is yours—find another way to gain favor or try your luck elsewhere.
[[Try another time..->ClearSkyAzureDragonPavilion][$pe=0]]
[[Try through duels!->Clear Sky Azure Dragon Pavilion Joining Scene][$pe=2]]
<</if>>
<<elseif $pe eq 2>>
<<CreateNPC_Region1>>
You stand at the middle of stage, people are watching you.
You'll face _fullname
You can gauge their strength by observing their stance and aura. He is at _realm.
<<BeforeBattle>>
<<set $currentEnemy.sectNPC to "Clear Sky Azure Dragon Pavilion">>
<<link "Attack" "SectEntranceBattle1">><<set $pe to 0>>
<<set $passage to "SectEntranceBattle1">>
<</link>>
<<elseif $pe eq 3>>
<<if $health lte 0>>
Your legs give out as the final blow lands. The stage spins, and everything fades to white.
$currentEnemy.fullname stands tall, their breathing calm but sharp.
"You fought bravely... but you lack experience. Train harder, and perhaps fate will smile upon you next time."
The disciples around the stage whisper, some nodding in respect, others looking unimpressed.
<<link "Leave in shame!" "Map|Region1">><<set $pe to 0>><</link>>
<<elseif $currentEnemy.NPCcurrenthealth lte 0>>
With one final strike, your opponent stumbles backward, collapsing to the stage.
A hush falls over the crowd.
$currentEnemy.fullname grits their teeth. "You... you are strong. The elders were right to test you."
An elder descends from the pavilion steps, his long white beard fluttering in the breeze.
"You have proven your determination and strength through battle. The Clear Sky Azure Dragon Pavilion welcomes you."
<<link "Continue" "ClearSkyAzureDragonPavilion">>
<<set $pe = 0>>
<<set $CurrentPcSectRank to "Initiate">>
<<set $CurrentPcAffiliation to "Clear Sky Azure Dragon Pavilion">>
<<set $CurrentPcMainSect to "Azure Dragon Sect">>
<<set $CurrentPcSect to "righteous">>
<</link>>
<</if>>
<</if>><div style="text-align:center;">
<img src="images/Locations/clearskyazure.jpg" class="location-bg" style="width:80%; border: 1px solid #00ced1; box-shadow: 0 0 15px rgba(0, 206, 209, 0.3);">
<h2 class="town-title" style="color:#00ced1; text-shadow: 0 0 10px rgba(0, 206, 209, 0.5);">碧空青龙阁</h2>
<div style="font-size: 0.9em; color: #00ced1; margin-top:-5px;">— Clear Sky Azure Dragon Pavilion —</div>
</div>
<<nobr>>
<<set $passage to passage()>>
<p style="font-style:italic; color:#aaa; text-align:center; max-width:500px; margin: 10px auto;">
The gates of the sect loom before you — ancient, imposing, and pulsing faintly with qi.
Disciples in azure robes patrol the entrance, scrutinizing newcomers.
</p>
<div class="city-grid" style="border-color: #00ced1;">
/* Top Row: Information and Exit */
<<link '<span class="nav-card">📜 Sect Info</span>' "CSADP">><</link>>
<<link '<span class="nav-card exit-btn">⬅ Exit Gates</span>' "Map|Region1">><<set $pe to 0>><</link>>
/* Facility: Hospital */
<<if $CurrentPcMainSect neq "Azure Dragon Sect">>
<span class="nav-card disabled">Hospital (Locked)</span>
<<else>>
<span class="nav-card disabled">Hospital (Locked)</span>
<</if>>
/* Facility: Portal (Usually open to all) */
<<link '<span class="nav-card">🌀 Spirit Portal</span>' "Portal|Stage 1">><<set $pe to 0>><</link>>
/* Facility: Manual Library */
<<if $CurrentPcMainSect neq "Azure Dragon Sect">>
<span class="nav-card disabled">Library (Locked)</span>
<<else>>
<<link '<span class="nav-card">📚 Manual Library</span>' "Manual Library|Stage 1">><<set $pe to 0>><<set $selectedFloor to "Initiate">><</link>>
<</if>>
/* Facility: Treasure Pavilion */
<<if $CurrentPcMainSect neq "Azure Dragon Sect">>
<span class="nav-card disabled">Treasury (Locked)</span>
<<else>>
<<link '<span class="nav-card">💎 Treasure Pavilion</span>' "Treasure Pavilion|Stage 1">><<set $pe to 0>><</link>>
<</if>>
/* Facility: Mission Hall */
<<if $CurrentPcMainSect neq "Azure Dragon Sect">>
<span class="nav-card disabled">Missions (Locked)</span>
<<else>>
<<link '<span class="nav-card">⚔️ Mission Hall</span>' "Mission Hall|Stage 1">><<set $pe to 0>><</link>>
<</if>>
/* Facility: Spirit Pavilion */
<<if $CurrentPcMainSect neq "Azure Dragon Sect">>
<span class="nav-card disabled">Spirit Pavilion (Locked)</span>
<<else>>
<<link '<span class="nav-card">✨ Spirit Pavilion</span>' "Spirit Pavilion|Stage 1">><<set $pe to 0>><</link>>
<</if>>
/* Facility: Council Hall (Bottom Span) */
<<if $CurrentPcMainSect neq "Azure Dragon Sect">>
<span class="nav-card disabled" style="grid-column: span 2;">Council Hall (Elders Only)</span>
<<else>>
<<link '<span class="nav-card" style="grid-column: span 2;">🏛️ Council Hall</span>' "Council Hall|Stage 1">><<set $pe to 0>><</link>>
<</if>>
/* Facility: Housing */
<<if $CurrentPcMainSect neq "Azure Dragon Sect">>
<span class="nav-card disabled" style="grid-column: span 2;">Housing (Locked)</span>
<<else>>
<<link '<span class="nav-card" style="grid-column: span 2;">� Housing</span>' "Housing">><<set $pe to 0>><</link>>
<</if>>
</div>
<<DisplayNPCS "sect" "Clear Sky Azure Dragon Pavilion">>
<</nobr>>[[Go back->GhostKingNetherworldSect]]
<div class="sect-info">
<h2>Ghost King Netherworld Sect</h2>
<p><b>Sect Purpose:</b> To dominate the mortal and spiritual realms.</p>
<p><b>Sect Rules:</b> Never betray the Sect.</p>
<hr>
<p><b>Your Position:</b></p>
<<if $CurrentPcMainSect != "Azure Dragon Sect" and $CurrentPcMainSect != "Ghost King Sect">>
<<link "Join the Sect">>
<<goto "GhostKingNetherworldSectJoiningScene">>
<</link>>
<<elseif $CurrentPcMainSect neq "Ghost King Sect">>
<ul>
<li><b>You're not part of this sect!</b></li>
</ul>
<<elseif $CurrentPcMainSect == "Ghost King Sect">>
<ul>
<li><b>Rank:</b> <<print $CurrentPcSectRank>></li>
<li><b>Reputation:</b> <<print $CurrentPcSectReputation>></li>
</ul>
<</if>>
</div><div style="text-align:center;">
<img src="images/Locations/ghostkingsect.jpg" class="location-bg" style="width:80%; border: 1px solid #9400d3;">
<h2 class="ghostly-title">幽冥鬼王宗</h2>
<div style="font-size: 0.8em; color: #9400d3; margin-top:-5px; letter-spacing: 2px;">— Ghost King Netherworld Sect —</div>
</div>
<<nobr>>
<<set $passage to passage()>>
<p style="font-style:italic; color:#888; text-align:center; max-width:500px; margin: 10px auto; font-size: 0.9em;">
The gates of the sect loom before you — ancient, imposing, and pulsing with a cold, spectral qi.
Disciples clad in dark, flowing robes watch your every move with hollow eyes.
</p>
<div class="city-grid ghostly-grid">
/* Top Row */
<<link '<span class="nav-card">💀 Sect Info</span>' "GKNS">><</link>>
<<link '<span class="nav-card exit-btn">⬅ Exit Gates</span>' "Map|Region1">><<set $pe to 0>><</link>>
/* Facility: Hospital (Currently non-functional based on your code) */
<span class="nav-card disabled">Hospital (Locked)</span>
/* Facility: Portal */
<<link '<span class="nav-card">🌀 Nether Portal</span>' "Portal|Stage 1">><<set $pe to 0>><</link>>
/* Facility: Manual Library */
<<if $CurrentPcMainSect neq "Ghost King Sect">>
<span class="nav-card disabled">Forbidden Library (Locked)</span>
<<else>>
<<link '<span class="nav-card">📜 Manual Library</span>' "Manual Library|Stage 1">><<set $pe to 0>><</link>>
<</if>>
/* Facility: Treasure Pavilion */
<<if $CurrentPcMainSect neq "Ghost King Sect">>
<span class="nav-card disabled">Treasury (Locked)</span>
<<else>>
<<link '<span class="nav-card">💎 Treasure Pavilion</span>' "Treasure Pavilion|Stage 1">><<set $pe to 0>><</link>>
<</if>>
/* Facility: Mission Hall */
<<if $CurrentPcMainSect neq "Ghost King Sect">>
<span class="nav-card disabled">Dark Missions (Locked)</span>
<<else>>
<<link '<span class="nav-card">⚔️ Mission Hall</span>' "Mission Hall|Stage 1">><<set $pe to 0>><</link>>
<</if>>
/* Facility: Spirit Pavilion */
<<if $CurrentPcMainSect neq "Ghost King Sect">>
<span class="nav-card disabled">Spirit Pavilion (Locked)</span>
<<else>>
<<link '<span class="nav-card">✨ Spirit Pavilion</span>' "Spirit Pavilion|Stage 1">><<set $pe to 0>><</link>>
<</if>>
/* Facility: Council Hall */
<<if $CurrentPcMainSect neq "Ghost King Sect">>
<span class="nav-card disabled" style="grid-column: span 2;">Ghost King's Throne (Locked)</span>
<<else>>
<<link '<span class="nav-card" style="grid-column: span 2;">🏛️ Council Hall</span>' "Council Hall|Stage 1">><<set $pe to 0>><</link>>
<</if>>
<<if $CurrentPcMainSect neq "Ghost King Sect">>
<span class="nav-card disabled" style="grid-column: span 2;">Housing (Locked)</span>
<<else>>
<<link '<span class="nav-card" style="grid-column: span 2;">� Housing</span>' "Housing">><<set $pe to 0>><</link>>
<</if>>
</div>
<<DisplayNPCS "sect" "Ghost King Netherworld Sect">>
<</nobr>><<if $pe eq 0>>
<<set $returnpassage to passage()>>
<<if $recommendationLetter eq "evil">>
Variant 1: Player has a recommendation letter
You stand at the entrance of the Ghost King Netherworld Sect, the sacred grounds of the sect stretching out before you. The towering structures of ancient stone and wood stand with an aura of power and wisdom. The sound of distant cultivation practices echoes across the courtyard as disciples train and meditate, their movements graceful and precise.
You take a deep breath, clutching the sealed recommendation letter you received earlier. The sect’s disciple eyes the letter, and a respectful nod follows.
“I see you’ve been vouched for. The Pavilion welcomes you.”
With that, he gestures toward the main building, allowing you to pass.
You have been accepted into the sect, your future now intertwined with the Ghost King Netherworld Sect.
You may now begin your training and cultivate under their guidance.
<<link "Continue" "GhostKingNetherworldSect">>
<<set $CurrentPcSectRank to "Initiate">>
<<set $CurrentPcAffiliation to "Ghost King Netherworld Sect">>
<<set $CurrentPcMainSect to "Ghost King Sect">>
<<set $CurrentPcSect to "demonic">>
<</link>>
<<else>>
You stand at the entrance of the Ghost King Netherworld Sect, the sacred grounds of the sect stretching out before you. The towering structures of ancient stone and wood stand with an aura of power and wisdom. The sound of distant cultivation practices echoes across the courtyard as disciples train and meditate, their movements graceful and precise.
You approach the entrance, heart racing with excitement at the thought of joining such a prestigious sect. A disciple standing guard raises an eyebrow, looking you over.
“Do you have a recommendation letter from a sect member or higher authority?” Without one, I’m afraid we cannot allow entry into the sect at this time. The path to true cultivation requires both merit and connections. However you may try to enter through duel trial. You'll face one of the sect initiates. If you manage to win, you'll be accepted”
With no recommendation in hand, you feel your chances slipping away. However, the sect is vast, and there may still be a way for you to prove yourself. The choice is yours—find another way to gain favor or try your luck elsewhere.
[[Try another time..->GhostKingNetherworldSect][$pe=0]]
[[Try through duels!->GhostKingNetherworldSectJoiningScene][$pe=2]]
<</if>>
<<elseif $pe eq 2>>
<<CreateNPC_Region1>>
You stand at the middle of stage, people are watching you.
You'll face _fullname
You can gauge their strength by observing their stance and aura. He is at _realm.
<<BeforeBattle>>
<<set $currentEnemy.sectNPC to "Ghost King Netherworld Sect">>
<<link "Attack" "SectEntranceBattle1">><<set $pe to 0>>
<<set $passage to "SectEntranceBattle1">>
<</link>>
<<elseif $pe eq 3>>
<<if $health lte 0>>
Your legs give out as the final blow lands. The stage spins, and everything fades to white.
<<= $currentEnemy.fullname>> stands tall, their breathing calm but sharp.
"You fought bravely... but you lack experience. Train harder, and perhaps fate will smile upon you next time."
The disciples around the stage whisper, some nodding in respect, others looking unimpressed.
<<link "Leave in shame!" "Map|Region1">><<set $pe to 0>><</link>>
<<elseif $currentEnemy.NPCcurrenthealth lte 0>>
With one final strike, your opponent stumbles backward, collapsing to the stage.
A hush falls over the crowd.
<<= $currentEnemy.fullname>> grits their teeth. "You... you are strong. The elders were right to test you."
An elder descends from the pavilion steps, his long white beard fluttering in the breeze.
"You have proven your determination and strength through battle. The Ghost King Netherworld Sect welcomes you."
<<link "Continue" "GhostKingNetherworldSect">>
<<set $pe = 0>>
<<set $CurrentPcSect to "demonic">>
<<set $CurrentPcSectRank to "Initiate">>
<<set $CurrentPcAffiliation to "Ghost King Netherworld Sect">>
<<set $CurrentPcMainSect to "Ghost King Sect">>
<</link>>
<</if>>
<</if>><<if $pe eq 0>>
You are fighting $currentEnemy.fullname !
<<EnemyImage $currentEnemy.enemyregion $currentEnemy.enemyimage 300>><</EnemyImage>>
<b>General Actions</b>:
<<link "Attack" "SectEntranceBattle1">>
<<set $pe to 1>>
<<set $playeraction = "attack">>
<</link>>
<table class="abilities-table">\
<td>\
<b>Abilities</b>:
<<for _i to 0; _i lt $skillInventory.length; _i++>>\
<<if ($skillInventory[_i].category eq "attack" or $skillInventory[_i].category eq "special") and $skillInventory[_i].isEquipped eq "true">>
<<print $skillInventory[_i].name>> (Energy cost: $skillInventory[_i].energy )\
<<capture _i>>\
<<if $energy lt $skillInventory[_i].energy>><i>Not enough energy</i>
<<else>> <<link "Use" "SectEntranceBattle1">>
<<set $pe = 1>><<set $playeraction = "ability">> <<set $ability = $skillInventory[_i].widgetname>> <<set $abilityenergy = $skillInventory[_i].energy>><<set $energy -= $abilityenergy>> <<set $abilitylevel = $skillInventory[_i].level>> <</link>> <</if>>
<</capture>>\
<</if>>
<</for>>\
</td>\
</table>
<<if $activePassiveSkill != "">>
<<Ability $activePassiveWidget>><</Ability>>
<</if>>
<<EnemyBattleTable>>
<<elseif $pe eq 1>>
<<if $playeraction eq "attack">>You attempt to hit the $currentEnemy.fullname !
<<PlayerAttackAttempt>>
<<if $playeraction = "attack success">>
<<PlayerAttackDamage>>
<<elseif $playeraction eq "attack failure">>
You missed your attack!
<</if>><</if>>
<<EnemyStun>>
<<if $enemyaction eq "attack">>The $currentEnemy.fullname attacks you!
<<EnemyAttackAttempt>>
<<if $enemyaction = "attack success">>
<<EnemyAttackDamage>>
<<elseif $enemyaction eq "attack failure">>
The $currentEnemy.fullname missed their attack!
<</if>><</if>>
<<if $playeraction eq "ability">>
<<Ability $ability>><</Ability>><</if>>
<<if $currentEnemy.NPCcurrenthealth lte 0>>
<<link "The enemy is defeated! Victory!" $returnpassage>><<set $pe = 3>><</link>>
<<elseif $health lte 0>>
<<link "You've lost" $returnpassage>><<set $pe to 3>><</link>><
<<else>>
<<link "Continue battle" $passage>><<set $pe = 0>><</link>>
<</if>>
<</if>><<set $sectItems to []>><div class="inn-scene nsfw">
<<set _awarenessRoll to random(1, 100)>>
<<set _visitorRoll to random(1, 100)>>
<<if _awarenessRoll gte 55>>
<<set $sleepState to "awake">>
<p class="dialogue">A heavy weight shifts on the mattress. Something hot and solid presses against your thigh. Your eyes snap open, mind still swimming in drowsiness.</p>
<<include InnEvent_NSFW_Awake>>
<<else>>
<<set $sleepState to "asleep">>
<p class="dialogue">Your dreams are black and empty. You never feel the blanket being pulled away, nor the calloused hand that slides under your clothes.</p>
<<include InnEvent_NSFW_Asleep>>
<</if>>
</div><<set _visitorRoll to random(1, 100)>>
/* The intruder is already in bed, exploiting your unconsciousness */
<<if _visitorRoll lte 25>>
/* VARIANT 1: Groping over clothes - teasing touch */
<img src="images/Sex/innSleep.webp" class="nsfw-glow">
<p>Rough hands roam your body with deliberate slowness, mapping you through your sleeping clothes. He traces the curve of your breast, squeezing with possessive firmness. His calloused fingers find your nipple and pinch—not hard enough to hurt, but hard enough to make you gasp in your sleep.</p>
<p>A low, predatory chuckle rumbles from his chest. <span class="male">"Even unconscious, you respond to me."</span></p>
<p>His hand slides down your stomach, pressing flat against your belly before slipping beneath your waistband. He doesn't penetrate you yet—just cups your sex through your underwear, feeling the heat radiating from you. The pressure is firm, demanding, claiming.</p>
<p>You whimper softly, your hips twitching toward his touch. Your body seeks him out even in sleep, betraying you. He grinds his palm against your mound in slow circles, feeling your wetness begin to seep through the fabric.</p>
<p><span class="male">"Already soaked,"</span> he murmurs. <span class="male">"Your cunt's getting wet for me. Your body knows what it wants."</span></p>
<p>He continues until you're squirming beneath his hand, until your breathing becomes ragged and your hips are grinding back against his touch. Just as you're teetering on the edge of climax, he withdraws completely. You're left empty, aching, still half-asleep and thoroughly aroused.</p>
<p>He tucks himself away, taking a moment to admire his handiwork—your flushed skin, your parted lips, the wet spot soaking through your underwear—before slipping back out into the night.</p>
<p><em>The morning comes with confusion and an unfamiliar ache between your thighs.</em></p>
<<link "Wake up to sticky underwear" "InnEvent_NSFW_Morning">>
<<set $pe to 0>>
<<if $corruption lte 20>>
<<set $corruption to ($corruption or 0) + 1>>
<</if>>
<<restEffect>>
<</link>>
<<elseif _visitorRoll lte 50>>
/* VARIANT 2: Finger penetration while sleeping */
<img src="images/Sex/innFingering.webp" class="nsfw-glow">
<p>Your thighs are nudged apart with casual dominance. He yanks your underwear to the side—no patience, no ceremony. The cool night air hits your exposed sex before his thick, calloused fingers replace it, sliding between your slick folds.</p>
<p>You're already wet. Your body has prepared itself for him without your conscious consent.</p>
<p><span class="male">"Fuck, look at this wet pussy,"</span> he growls, satisfaction dripping from every word. <span class="male">"Dreaming about my cock, aren't you?"</span></p>
<p>A single finger traces your entrance, feeling the way your muscles tighten involuntarily. Then two fingers push inside, stretching you open. He pumps them in and out—deep, slow strokes—while his thumb rubs your clit in firm circles.</p>
<p>Your hips buck in your sleep, grinding down on his hand. Soft moans escape your throat as he works you with deliberate precision, building the tension inside you. Your wetness increases, coating his hand, dripping down to soak the sheets.</p>
<p><span class="male">"That's it. Take my fingers. Feel how deep they go."</span></p>
<p>He adds a third finger, stretching you further, and your back arches involuntarily. He fucks you with his hand, long strokes that pull almost completely out before driving back in, building you higher and higher toward climax. Just when you're about to come, right on the edge, he rips his hand away completely. The sudden emptiness jolts you briefly toward waking, but sleep pulls you back under before consciousness can claim you.</p>
<p>He brings his dripping fingers to his mouth and sucks them clean, groaning at the taste.</p>
<p><span class="male">"Mmm. Perfect. I'm coming back every night to fuck this cunt."</span></p>
<p><em>You wake feeling wrecked, sticky between your legs, sore in places you can't explain.</em></p>
<<link "Jolt awake confused" "InnEvent_NSFW_Morning">>
<<set $pe to 0>>
<<if $corruption lte 25>>
<<set $corruption to ($corruption or 0) + 2>>
<</if>>
<<set $energy to ($energy or 100) - 3>>
<<restEffect>>
<</link>>
<<elseif _visitorRoll lte 75>>
/* VARIANT 3: Oral sex while unconscious */
<img src="images/Sex/innCunlingus.webp" class="nsfw-glow">
<p>Your clothes are torn away with impatient hands. He spreads your legs wide and settles between them, and then his mouth is on your sex—hot, wet, aggressive. His tongue flicks across your clit hard while his hands grip your thighs, leaving bruises.</p>
<p>A gasp tears from your throat. Your hands claw at the sheets, but you never fully wake. You're trapped between dream and reality, aware only of the intense sensation of a mouth on your most sensitive flesh.</p>
<p>He eats your pussy with hunger, groaning like a starving man. His tongue pumps in and out of you, exploring you. When you try to close your thighs, he forces them apart again, pinning you, refusing to let you escape his mouth.</p>
<p><span class="male">"Don't fucking run from it. Stay open for me."</span></p>
<p>He brings you to orgasm with his tongue and lips, not stopping as you climax. Your body convulses, your back arching off the bed as pleasure crashes through you. You come hard, soaking his face, and he drinks it down like it's all he needs.</p>
<p>When you finally go completely limp, he sits up, licking his lips and chin, admiring how wet your thighs are, how slick his face is with you.</p>
<p><span class="male">"Delicious. I could eat this pussy all night."</span></p>
<p>But eventually, he leaves—slipping back out into the darkness, leaving you sprawled naked on the bed, completely used.</p>
<p><em>You wake with the ghost of a tongue on you and an ache you can't explain.</em></p>
<<link "Wake up flushed and confused" "InnEvent_NSFW_Morning">>
<<set $pe to 0>>
<<if $corruption lte 25>>
<<set $corruption to ($corruption or 0) + 2>>
<</if>>
<<set $energy to ($energy or 100) - 2>>
<<restEffect>>
<</link>>
<<elseif _visitorRoll lte 88>>
/* VARIANT 4: Masturbation and rutting - his pleasure, not yours */
<img src="images/Sex/innMasturbation.webp" class="nsfw-glow">
<p>He doesn't waste time with foreplay. His need is too urgent. His clothes are shrugged off and his cock springs free—already hard and leaking. He settles on top of you, straddling your hips, and wraps his hand around his shaft.</p>
<p>He strokes himself against you—his cock sliding between your thighs, rubbing against your sex, coating himself in your natural lubrication. It's pure selfish pleasure. You're just a warm object to him right now, an unconscious toy for his lust.</p>
<p>He fucks his own fist, his hips thrusting up into his grip as his cock continues to rub against your mound. Your unconscious body shifts with each movement, your breasts bouncing slightly with the force of his thrusts.</p>
<p><span class="male">"Fuck, yes. So good. Your body feels so fucking good."</span></p>
<p>He reaches down and grabs your breast roughly, using it as an anchor as he chases his own climax. His breathing becomes ragged, his pace more frantic. When he comes, it's with a low animalistic groan—spilling across your belly and thighs, marking you with his seed.</p>
<p>He remains there for a moment, breathing hard, admiring the mess he's made of you. The white streaks of cum covering your skin, your exposed breasts. Then he cleans himself on your sheets and disappears into the night.</p>
<p><em>You wake sticky and confused, your skin painted with dried cum.</em></p>
<<link "Wake up covered and bewildered" "InnEvent_NSFW_Morning">>
<<set $pe to 0>>
<<if $corruption lte 25>>
<<set $corruption to ($corruption or 0) + 2>>
<</if>>
<<set $energy to ($energy or 100) - 1>>
<<restEffect>>
<</link>>
<<else>>
/* VARIANT 5: Full penetration during deep sleep */
<img src="images/Sex/innPenetrationSleep.webp" class="nsfw-glow">
<p>He doesn't waste time with anything else. Your clothes are torn aside and his massive cock is already positioning itself at your entrance. You're wet enough from your dreams, from his earlier touches, and he takes full advantage.</p>
<p>He sheathes himself inside you in one brutal thrust, burying himself completely. Your sleeping body tenses around him, your walls clenching involuntarily, and he groans like he's found heaven.</p>
<p><span class="male">"Oh fuck. That's tight. Even asleep, you're perfect."</span></p>
<p>He sets a relentless pace, fucking you with power and purpose. The bed creaks beneath you both, the headboard slamming against the wall with each aggressive thrust. Your breasts bounce and sway with the force of his movements. A dribble of drool escapes the corner of your mouth as pleasure and violation blur together.</p>
<p>He grabs your hips hard enough to bruise, using them as leverage to drive himself deeper into your pussy. His grunts and groans fill the room—the sound of a man taking what he wants.</p>
<p><span class="male">"Such a perfect cunt. I could fuck this all night. Maybe I will. Maybe I'll come back every night and fill you with my cock."</span></p>
<p>His pace becomes more erratic as he chases his own release. His hand snakes down to rub your clit, forcing an orgasm from you even as he uses you. Your sleeping body responds—your pussy clenching around him so perfectly that he can't hold back any longer.</p>
<p>He buries himself deep one final time and comes, flooding you with his cum. You feel the warmth spreading inside you, coating your walls, and even in sleep your body shivers at the sensation of being filled.</p>
<p>He stays there for a long moment, still buried inside you, breathing hard. Then he withdraws slowly, watching as his cum begins to leak out of you, mixing with your own wetness.</p>
<p>He traces a finger through the mess and brings it to his mouth, tasting you mixed with himself.</p>
<p><span class="male">"I'll be back. This pussy is mine now."</span></p>
<p><em>You never wake. The sheets beneath you are soaked with the evidence of what he did to you.</em></p>
<<set $morningEvent to "inn_creampie">>
<<link "Wake up to sticky reality" "InnEvent_NSFW_Morning">>
<<set $pe to 0>>
<<if $corruption lte 35>>
<<set $corruption to ($corruption or 0) + 3>>
<</if>>
<<if $virginity eq 1>>
<<set $virginity = 0>>
<<set $virginityLost = "Nightly Intruder">>
<</if>>
<<set $energy to ($energy or 100) - 6>>
<<restEffect>>
<</link>>
<</if>><p>A man looms over you, features lost in shadow. Broad, muscular, reeking of sweat and something raw. One of his hands is already inside your pants, fingers curled around your most private flesh, stroking slowly.</p>
<img src="images/Sex/innCaughtHim.webp" class="nsfw-glow">
<p><span class="male">"You've been driving me crazy for days,"</span> he growls, his voice rough as gravel. <span class="male">"The way you move. The strength in you. I've been watching you. Had to have you."</span></p>
<p>His fingers continue their work, stroking your hardening length or rubbing your slick folds. Either way, your body betrays you, responding to his touch despite your shock.</p>
<br>
<<link "Pretend you're still asleep and don't resist" "InnEvent_NSFW_FakeSleep">>
<<set $awakeChoice to "fake_sleep">>
<</link>>
<br>
<<link "Grab his wrist and fight back" "InnEvent_NSFW_Resist">>
<<set _resistRoll to random(1, 100)>>
<<set $awakeChoice to "resist">>
<</link>>
<br>
<<if $corruption gte 30>><<link "Surrender immediately—let him take you" "InnEvent_NSFW_Willing">>
<<set $awakeChoice to "surrender">>
<</link>><</if>><img src="images/Sex/innResist.webp" class="nsfw-glow">
<<if _resistRoll gte 45>>
<p>You snarl and snatch his wrist, your reflexes sharper than expected. The man hisses in surprise as you throw him off balance. His grip loosens for just a moment—long enough for you to shove him away and roll out of bed.</p>
<p><span class="male">"Feisty,"</span> he breathes, and there's something almost admiring in his tone. <span class="male">"I fucking love that."</span></p>
<p>He reaches for you again, but you grab your blade, pressing it against his throat. His eyes—glowing faintly red in the darkness—meet yours, and for a moment the world holds its breath.</p>
<p><span class="male">"Smart,"</span> he says, and despite the weapon, he's smiling. <span class="male">"But this isn't over. I always get what I want."</span></p>
<p>He backs toward the window slowly, never taking his eyes off you. Before he disappears into the night, he drags a finger down the wall, leaving a glowing trail of his essence.</p>
<p><span class="male">"Next time, you won't have a weapon in hand. And I'll have you begging for my cock."</span></p>
<<set $pe to 0>>
<<if $corruption lte 20>>
<<set $corruption to ($corruption or 0) + 1>>
<</if>>
<<restEffect>>
<p><<link "Go back to sleep, shaken" "InnEvent_NSFW_Morning">><</link>></p>
<<else>>
<p>Your attempt is futile. He catches your wrist easily, his strength overwhelming. In one smooth motion, he twists your arm behind your back and forces you face-first into the mattress. Your blade clatters to the floor, forgotten.</p>
<p><span class="male">"I like when you fight,"</span> he snarls, his weight pressing you down completely. <span class="male">"Makes your cunt grip me tighter."</span></p>
<p>You're pinned completely, unable to move, unable to escape what comes next.</p>
<<set $morningEvent to "inn_creampie">>
<<goto "InnEvent_NSFW_Overpowered">>
<</if>><img src="images/Sex/innFakeSleep.webp" class="nsfw-glow">
<p>You force your breathing to remain steady, closing your eyes. Your heart hammers in your chest, but you don't move. Don't protest. The thrill of being taken while feigning unconsciousness—of letting him believe he's violating you—sends heat flooding through your body.</p>
<p>A satisfied growl rumbles from his throat. <span class="male">"Knew it. I fucking knew you'd be into this."</span></p>
<p>His hand continues its work, growing more insistent. His other hand moves to your chest, squeezing roughly, pinching your nipple hard enough to make you gasp.</p>
<p><span class="male">"That's it. Let me hear you."</span></p>
<p>He pulls your clothes aside entirely now, exposing you completely. The night air hits your bare flesh and you feel your body respond—wetness building, arousal spreading like wildfire.</p>
<p>His fingers sink into you—two, then three—pumping hard and fast. Your fake sleep shatters as genuine pleasure overtakes you. A moan escapes, and he chuckles darkly.</p>
<p><span class="male">"That's right. You want this. You want me to fuck you like an animal."</span></p>
<<set _fakeAsleepRoll to random(1, 100)>>
<<if _fakeAsleepRoll lte 40>>
<!-- He takes his time, savoring -->
<p>He enters you slowly, deliberately, letting you feel every inch of his cock as he sinks into you. It's a long, luxurious stroke that seems to last forever. When he's fully inside, he stays there for a moment, grinding against you, letting you adjust to his size.</p>
<p><span class="male">"Fuck, you're tight. Even better than I imagined."</span></p>
<p>He begins to thrust—long, deep strokes, controlled but intense. His hand wraps around your throat—not choking, just claiming—as he fucks you with methodical precision. He's determined to make you feel every moment of it.</p>
<p>When you climax, he's right there with you, feeling your pussy clench around his cock, and it pushes him over the edge. He comes with a low groan, burying himself deep as he floods you with his cum.</p>
<<if $corruption lte 40>>
<<set $corruption to ($corruption or 0) + 2>>
<</if>>
<<elseif _fakeAsleepRoll lte 75>>
<!-- He takes you hard, chasing his own pleasure -->
<p>He doesn't give you time to adjust. He slams into you, setting a punishing pace from the start. The bed rocks beneath you, the headboard slamming against the wall. Your body bounces with each thrust, completely at his mercy.</p>
<p><span class="male">"This is what you want, right? To be fucked hard? To be used?"</span></p>
<p>He grabs your hips and flips you onto your belly. From behind, he's even deeper, and when he pounds into you from this angle, you scream his name.</p>
<p>He fucks you through two orgasms before he finally comes, his thrusts turning frantic as he chases his release. When he spills inside you, it's with a sound that's almost animal.</p>
<<if $corruption lte 40>>
<<set $corruption to ($corruption or 0) + 3>>
<</if>>
<<else>>
<!-- He goes feral, multiple rounds -->
<p>He pounds into you like a man possessed, completely lost to instinct and hunger. His hands grip your body hard enough to leave bruises. His mouth finds your neck and bites, marking you with the ferocity of his desire.</p>
<p><span class="male">"You're mine. Every fucking part of you is mine. No one else will ever fuck you like this."</span></p>
<p>He takes you three times that night—different positions, different angles, each one leaving you more wrecked than the last. By the time he's finally satisfied, you're a trembling, soaked, utterly destroyed mess beneath him.</p>
<p>When he finally leaves, you collapse into an exhausted, dreamless sleep.</p>
<<if $corruption lte 40>>
<<set $corruption to ($corruption or 0) + 3>>
<</if>>
<</if>>
<<set $morningEvent to "inn_creampie">>
<<if $virginity eq 1>>
<<set $virginity = 0>>
<<set $virginityLost = "Nightly Intruder">>
<</if>>
<<set $pe to 0>>
<<set $energy to ($energy or 100) - 8>>
<<restEffect>>
<p><<link "Collapse in satisfied exhaustion" "InnEvent_NSFW_Morning">><</link>></p><p>You're pinned completely, your struggle only arousing him further. He tears your clothes away with brutal efficiency, his hunger overriding any concern for your comfort.</p>
<img src="images/Sex/innOverpowered.webp" class="nsfw-glow">
<p><span class="male">"I've been patient,"</span> he snarls in your ear. <span class="male">"Watching you, waiting for the right moment. Now I'm done waiting."</span></p>
<p>He positions himself and enters you with zero gentleness, burying his cock completely in one harsh thrust that forces the air from your lungs. A broken cry tears from your throat.</p>
<p><span class="male">"That's it. Let me hear you scream."</span></p>
<p>He fucks you with pure lust. Your struggles only fuel him. The bed slams against the wall repeatedly. You're nothing but a vessel for his need right now, your body claimed and used with no regard for anything but his satisfaction.</p>
<<set _overpoweredRoll to random(1, 100)>>
<<if _overpoweredRoll lte 50>>
<p>He grunts with each thrust, lost in the sensation of you. Eventually, your body betrays you—pleasure overwrites protest, and you find yourself meeting his thrusts. This realization only drives him harder.</p>
<p><span class="male">"Yes. That's right. Your body knows what it wants. It wants my cock."</span></p>
<p>When he comes, he buries himself deep, flooding you with his cum. You climax moments later, your body convulsing around him.</p>
<<if $corruption lte 40>>
<<set $corruption to ($corruption or 0) + 3>>
<</if>>
<<else>>
<p>He fucks you relentlessly, chasing his own pleasure without waiting for yours. His hand grabs a fistful of your hair, pulling your head back, arching your spine. The other hand grips your hip hard enough to bruise.</p>
<p><span class="male">"So beautiful when you're helpless. So fucking perfect."</span></p>
<p>He comes with a grunt, spilling deep inside you, then collapses briefly before pulling out. As he dresses, he traces a finger down your back.</p>
<p><span class="male">"I'll be back for more. You're mine now."</span></p>
<<if $corruption lte 40>>
<<set $corruption to ($corruption or 0) + 3>>
<</if>>
<</if>>
<<set $morningEvent to "inn_creampie">>
<<if $virginity eq 1>>
<<set $virginity = 0>>
<<set $virginityLost = "Nightly Intruder">>
<</if>>
<<set $pe to 0>>
<<set $energy to ($energy or 100) - 10>>
<<restEffect>>
<p><<link "Lie there, trembling and used" "InnEvent_NSFW_Morning">><</link>></p><p>The fight drains out of you. Fear and desire tangle together until you can't tell them apart. His hand on your sex. His massive frame looming over you. The predatory hunger radiating from him.</p>
<p>You want this. You don't know why, but you want it desperately.</p>
<p><span class="player">"Yes,"</span> you breathe, spreading your legs wider. <span class="player">"Take me. Fuck me."</span></p>
<p>He grins—dangerous and satisfied. <span class="male">"That's what I wanted to hear."</span></p>
<img src="images/Sex/innWillingly.webp" class="nsfw-glow">
<p>Without another word, he positions himself and thrusts inside you, burying his cock completely. The stretch is intense, overwhelming, perfect.</p>
<p><span class="male">"Fuck. I knew you wanted it. Your body's been calling to me since the moment you walked in."</span></p>
<p>He establishes a steady rhythm—deep, purposeful strokes. His hand finds your clit and rubs in firm circles. You're caught between the fullness inside you and the stimulation outside, building rapidly toward something explosive.</p>
<<set _willingRoll to random(1, 100)>>
<<if $virginity eq 1>>
<<set $virginity = 0>>
<<set $virginityLost = "Nightly Intruder">>
<</if>>
<<if _willingRoll lte 35>>
<!-- Tender but possessive -->
<p>His pace is slower than expected, almost reverent. He takes his time with you, kissing your neck, your shoulders, murmuring filthy praise against your skin.</p>
<p><span class="male">"So responsive. I'm going to ruin you for anyone else. You'll never want anyone but me inside you."</span></p>
<p>When you climax, he's right there, his own release following moments later. He stays inside you, unwilling to break the connection.</p>
<<if $corruption lte 40>>
<<set $corruption to ($corruption or 0) + 3>>
<</if>>
<<elseif _willingRoll lte 70>>
<!-- Hard and demanding -->
<p>He loses control quickly, his pace becoming frantic. He flips you onto your side and enters you again, his hips driving against your ass with relentless force. Raw, primal fucking—him chasing his pleasure while making sure you're right there with him.</p>
<p><span class="male">"Tell me you want it. Tell me you're mine."</span></p>
<p><span class="player">"I'm yours,"</span> you gasp, and the words are true. In this moment, you absolutely are.</p>
<<if $corruption lte 40>>
<<set $corruption to ($corruption or 0) + 3>>
<</if>>
<<else>>
<!-- Multiple rounds of intense fucking -->
<p>He takes you multiple times throughout the night—different positions, different angles. Each time you approach climax, he shifts, keeping you balanced on that knife's edge until he decides you can come.</p>
<p>By the time he's finally spent, you've climaxed more times than you can count. Your body is wrung out, thoroughly satisfied, completely wrecked.</p>
<<if $corruption lte 40>>
<<set $corruption to ($corruption or 0) + 3>>
<</if>>
<</if>>
<<set $morningEvent to "inn_creampie">>
<<set $virgin to false>>
<<set $pe to 0>>
<<set $energy to ($energy or 100) - 7>>
<<restEffect>>
<p><<link "Fall asleep in his arms" "InnEvent_NSFW_Morning">><</link>></p><<if $morningEvent eq "inn_creampie">>
<div class="morning-after">
<img src="images/Sex/innMorningAfter.webp" class="nsfw-glow">
<p>You wake to a damp, sticky mess between your thighs. The sheets are soaked. A thick, musky scent clings to your skin and hair—his scent mixed with yours.</p>
<p>When you sit up, something warm trails down your leg. His cum, still seeping from your sore, tender entrance, mixing with your own arousal.</p>
<p>Bruises bloom across your hips, your thighs, your neck. Bite marks bruise your shoulders and breasts. Your legs shake when you try to stand. Every movement reminds you—you've been thoroughly fucked.</p>
<<if $awakeChoice eq "resist">>
<p>The violation burns in your memory. But so does the heat that pools between your legs when you remember his dominance, the way he forced you open, the way your body responded despite your protests.</p>
<<elseif $awakeChoice eq "surrender">>
<p>You touch the marks on your skin with a strange mix of shame and pride. He claimed you completely. Fucked you like you were his to use. And some part of you—the part you don't want to admit exists—loved every second of it.</p>
<<elseif $awakeChoice eq "fake_sleep">>
<p>You can still feel the ghost of him inside you, still taste him on your lips. The memory of pretending to sleep while he fucked you is already searing itself into your mind. The fact that you got off on it, that your pussy clenched around his cock, is burned into your body's memory.</p>
<</if>>
<p>Your body aches in the best way. Your pussy is sore, tender, used. There's cum drying on your inner thighs and stomach. You should feel violated. Instead, you feel like a claim has been made.</p>
<p>The innkeeper gives you a knowing smirk as you stumble past, your gait unsteady, your body clearly ravaged. Everyone can see exactly what happened to you last night.</p>
</div>
<<else>>
<</if>>
<<set $morningEvent to null>>
<<link "Get up" $passage>><<set $pe to 0>><</link>><<widget "HuntBeastsR1">>
<<set _chance = random(0,100)>>
<<if _chance lte 20>>
<<BloodfangTiger>>
<<elseif _chance gt 20 and _chance lt 40>>
<<IronclawBear>>
<<else>>
<<ScarletEagle>>
<</if>>
<</widget>>
<<widget "BloodfangTiger">>\
<<silently>>\
<<set _enemyability = []>>
<<set _enemyability.push("attack", "attack")>>
<<set _enemyregion = "Enemy">>
<<set _enemyimage = "Bloodfang Tiger">>
<<set _fullname = "Bloodfang Tiger">>
<<set _location = ["Jade Creek Town", "Northern Phoenix City", "Blood Sand Reach", "Hundred Sorrows Mountain"].random()>>
<<set _maxhealthNPC = random(340, 450)>>
<<set _maxenergyNPC = random(120, 160)>>
<<set _currenthealthNPC = _maxhealthNPC>>
<<set _currentenergyNPC = _maxenergyNPC>>
<<set _luckNPC = random(1, 5)>>
<<set _insightNPC = random(1, 5)>>
<<set _basestrengthNPC = random(7, 10)>>
<<set _basewillpowerNPC = random(4, 7)>>
<<set _atkNPC = random(6, 17)>>
<<set _defNPC = random(9, 16)>>
<<set _critNPC = random(2, 4)>>
<<set _critresNPC = random(0, 2)>>
<<set _agilityNPC = random(6, 13)>>
<<set _martialArtsNPC = random(0, 2)>>
<<set _enemyEXP = random (20,40)>>
<<set _spiritualRootNPC = random(0, 3)>>
<<set _enemyEvadeScore = (_agilityNPC * 2) + (_insightNPC * 1.5) + (_luckNPC * 0.5)>>
<<set _description = "You see Bloodfang Tiger, its crimson fur slick with dried blood. It growls lowly, its fangs pulsing with an ominous qi, thirsting for another soul.">>
<<set _npc = {
fullname: _fullname,
NPCmaxlifespan: _maxlifespanNPC,
NPClifespan: __lifespanNPC,
NPCmaxhealth: _maxhealthNPC,
NPCmaxenergy: _maxenergyNPC,
NPCcurrenthealth: _currenthealthNPC,
NPCcurrentenergy: _currentenergyNPC,
NPCluck: _luckNPC,
NPCinsight: _insightNPC,
NPCbasestrength: _basestrengthNPC,
NPCbasewillpower: _basewillpowerNPC,
NPCatk: _atkNPC,
NPCdef: _defNPC,
NPCcrit: _critNPC,
NPCcritres: _critresNPC,
NPCagility: _agilityNPC,
NPCmartialArts: _martialArtsNPC,
NPCspiritualRoot: _spiritualRootNPC,
NPClocation: _location,
enemyregion: _enemyregion,
enemyimage: _enemyimage,
enemyEvade: _enemyEvadeScore,
enemyAbility: _enemyability,
enemyDesc: _description,
enemyXP: _enemyEXP
}>>
<</silently>>\
<</widget>>\
<<widget "IronclawBear">>\
<<silently>>\
<<set _enemyability = []>>
<<set _enemyability.push("attack", "attack")>>
<<set _enemyregion = "Enemy">>
<<set _enemyimage = "Ironclaw Bear">>
<<set _fullname = "Ironclaw Bear">>
<<set _location = ["Jade Creek Town", "Northern Phoenix City", "Blood Sand Reach", "Hundred Sorrows Mountain"].random()>>
<<set _maxhealthNPC = random(340, 450)>>
<<set _maxenergyNPC = random(120, 160)>>
<<set _currenthealthNPC = _maxhealthNPC>>
<<set _currentenergyNPC = _maxenergyNPC>>
<<set _luckNPC = random(1, 5)>>
<<set _insightNPC = random(1, 5)>>
<<set _basestrengthNPC = random(7, 10)>>
<<set _basewillpowerNPC = random(4, 7)>>
<<set _atkNPC = random(6, 17)>>
<<set _defNPC = random(9, 16)>>
<<set _critNPC = random(2, 4)>>
<<set _critresNPC = random(0, 2)>>
<<set _agilityNPC = random(6, 13)>>
<<set _martialArtsNPC = random(0, 2)>>
<<set _spiritualRootNPC = random(0, 3)>>
<<set _enemyEXP = random (20,40)>>
<<set _enemyEvadeScore = (_agilityNPC * 2) + (_insightNPC * 1.5) + (_luckNPC * 0.5)>>
<<set _description = "You see Ironclaw Bear, a hulking beast with claws like sabers. The earth trembles with each of its heavy, deliberate steps.">>
<<set _npc = {
fullname: _fullname,
NPCmaxlifespan: _maxlifespanNPC,
NPClifespan: __lifespanNPC,
NPCmaxhealth: _maxhealthNPC,
NPCmaxenergy: _maxenergyNPC,
NPCcurrenthealth: _currenthealthNPC,
NPCcurrentenergy: _currentenergyNPC,
NPCluck: _luckNPC,
NPCinsight: _insightNPC,
NPCbasestrength: _basestrengthNPC,
NPCbasewillpower: _basewillpowerNPC,
NPCatk: _atkNPC,
NPCdef: _defNPC,
NPCcrit: _critNPC,
NPCcritres: _critresNPC,
NPCagility: _agilityNPC,
NPCmartialArts: _martialArtsNPC,
NPCspiritualRoot: _spiritualRootNPC,
NPClocation: _location,
enemyregion: _enemyregion,
enemyimage: _enemyimage,
enemyEvade: _enemyEvadeScore,
enemyAbility: _enemyability,
enemyXP: _enemyEXP,
enemyDesc: _description
}>>
<</silently>>\
<</widget>>\
<<widget "ScarletEagle">>\
<<silently>>\
<<set _enemyability = []>>
<<set _enemyability.push("attack", "attack")>>
<<set _enemyregion = "Enemy">>
<<set _enemyimage = "Scarlet Eagle">>
<<set _fullname = "Scarlet Eagle">>
<<set _location = ["Jade Creek Town", "Northern Phoenix City", "Blood Sand Reach", "Hundred Sorrows Mountain"].random()>>
<<set _maxhealthNPC = random(340, 450)>>
<<set _maxenergyNPC = random(120, 160)>>
<<set _currenthealthNPC = _maxhealthNPC>>
<<set _currentenergyNPC = _maxenergyNPC>>
<<set _luckNPC = random(1, 5)>>
<<set _insightNPC = random(1, 5)>>
<<set _basestrengthNPC = random(7, 10)>>
<<set _basewillpowerNPC = random(4, 7)>>
<<set _atkNPC = random(6, 17)>>
<<set _defNPC = random(9, 16)>>
<<set _critNPC = random(2, 4)>>
<<set _critresNPC = random(0, 2)>>
<<set _agilityNPC = random(6, 13)>>
<<set _martialArtsNPC = random(0, 2)>>
<<set _spiritualRootNPC = random(0, 3)>>
<<set _enemyEXP = random (20,40)>>
<<set _enemyEvadeScore = (_agilityNPC * 2) + (_insightNPC * 1.5) + (_luckNPC * 0.5)>>
<<set _description = "You see Scarlet Eagle, circling above. Its cry echoes sharply across the valley as it dives with blinding speed.">>
<<set _npc = {
fullname: _fullname,
NPCmaxlifespan: _maxlifespanNPC,
NPClifespan: __lifespanNPC,
NPCmaxhealth: _maxhealthNPC,
NPCmaxenergy: _maxenergyNPC,
NPCcurrenthealth: _currenthealthNPC,
NPCcurrentenergy: _currentenergyNPC,
NPCluck: _luckNPC,
NPCinsight: _insightNPC,
NPCbasestrength: _basestrengthNPC,
NPCbasewillpower: _basewillpowerNPC,
NPCatk: _atkNPC,
NPCdef: _defNPC,
NPCcrit: _critNPC,
NPCcritres: _critresNPC,
NPCagility: _agilityNPC,
NPCmartialArts: _martialArtsNPC,
NPCspiritualRoot: _spiritualRootNPC,
NPClocation: _location,
enemyregion: _enemyregion,
enemyimage: _enemyimage,
enemyEvade: _enemyEvadeScore,
enemyAbility: _enemyability,
enemyXP: _enemyEXP,
enemyDesc: _description
}>>
<</silently>>\
<</widget>>\
<<widget "WhisperingShade">>
<<silently>>
<<set _enemyability = []>>
<<set _enemyability.push("attack")>>
<<set _enemyregion = "Enemy">>
<<set _enemyimage = "Whispering Shade">>
<<set _fullname = "Whispering Shade">>
<<set _location = ["Bamboo Grove of Whispers", "Forgotten Burial Ground", "Moonlit Ravine"].random()>>
<<set _maxhealthNPC = random(280, 360)>>
<<set _maxenergyNPC = random(160, 220)>>
<<set _currenthealthNPC = _maxhealthNPC>>
<<set _currentenergyNPC = _maxenergyNPC>>
<<set _luckNPC = random(2, 6)>>
<<set _insightNPC = random(6, 10)>>
<<set _basestrengthNPC = random(3, 6)>>
<<set _basewillpowerNPC = random(8, 12)>>
<<set _atkNPC = random(5, 12)>>
<<set _defNPC = random(7, 12)>>
<<set _critNPC = random(3, 6)>>
<<set _critresNPC = random(2, 5)>>
<<set _agilityNPC = random(8, 14)>>
<<set _martialArtsNPC = random(0, 1)>>
<<set _spiritualRootNPC = random(2, 4)>> <!-- Ghostly affinity -->
<<set _enemyEXP = random(35, 55)>>
<<set _enemyEvadeScore = (_agilityNPC * 2.2) + (_insightNPC * 1.8) + (_luckNPC * 0.5)>>
<<set _description = "A ghostly cultivator manifests from the shadows, its form wavering like smoke in the moonlight. Hollow eyes burn faintly as the whispers in the bamboo rise to a maddening chorus.">>
<<set _npc = {
fullname: _fullname,
NPCmaxhealth: _maxhealthNPC,
NPCmaxenergy: _maxenergyNPC,
NPCcurrenthealth: _currenthealthNPC,
NPCcurrentenergy: _currentenergyNPC,
NPCluck: _luckNPC,
NPCinsight: _insightNPC,
NPCbasestrength: _basestrengthNPC,
NPCbasewillpower: _basewillpowerNPC,
NPCatk: _atkNPC,
NPCdef: _defNPC,
NPCcrit: _critNPC,
NPCcritres: _critresNPC,
NPCagility: _agilityNPC,
NPCmartialArts: _martialArtsNPC,
NPCspiritualRoot: _spiritualRootNPC,
NPClocation: _location,
enemyregion: _enemyregion,
enemyimage: _enemyimage,
enemyEvade: _enemyEvadeScore,
enemyAbility: _enemyability,
enemyXP: _enemyEXP,
enemyDesc: _description
}>>
<</silently>>
<</widget>>
<<widget "ShadowtailBeast">>\
<<silently>>\
<<set _enemyability = []>>
<<set _enemyability.push("attack", "attack")>>
<<set _enemyregion = "Enemy">>
<<set _enemyimage = "Shadowtail Beast">>
<<set _fullname = "Shadowtail Beast">>
<<set _location = ["Jade Creek Town", "Northern Phoenix City", "Blood Sand Reach", "Hundred Sorrows Mountain"].random()>>
<<set _maxhealthNPC = random(340, 450)>>
<<set _maxenergyNPC = random(120, 160)>>
<<set _currenthealthNPC = _maxhealthNPC>>
<<set _currentenergyNPC = _maxenergyNPC>>
<<set _luckNPC = random(1, 5)>>
<<set _insightNPC = random(1, 5)>>
<<set _basestrengthNPC = random(7, 10)>>
<<set _basewillpowerNPC = random(4, 7)>>
<<set _atkNPC = random(6, 17)>>
<<set _defNPC = random(9, 16)>>
<<set _critNPC = random(2, 4)>>
<<set _critresNPC = random(0, 2)>>
<<set _agilityNPC = random(6, 13)>>
<<set _martialArtsNPC = random(0, 2)>>
<<set _enemyEXP = random (20,40)>>
<<set _spiritualRootNPC = random(0, 3)>>
<<set _enemyEvadeScore = (_agilityNPC * 2) + (_insightNPC * 1.5) + (_luckNPC * 0.5)>>
<<set _description = "You see Shadowtail Beast, its sleek dark fur glistening with a faint glow. It growls lowly, its eyes glowing violet.">>
<<set _npc = {
fullname: _fullname,
NPCmaxlifespan: _maxlifespanNPC,
NPClifespan: __lifespanNPC,
NPCmaxhealth: _maxhealthNPC,
NPCmaxenergy: _maxenergyNPC,
NPCcurrenthealth: _currenthealthNPC,
NPCcurrentenergy: _currentenergyNPC,
NPCluck: _luckNPC,
NPCinsight: _insightNPC,
NPCbasestrength: _basestrengthNPC,
NPCbasewillpower: _basewillpowerNPC,
NPCatk: _atkNPC,
NPCdef: _defNPC,
NPCcrit: _critNPC,
NPCcritres: _critresNPC,
NPCagility: _agilityNPC,
NPCmartialArts: _martialArtsNPC,
NPCspiritualRoot: _spiritualRootNPC,
NPClocation: _location,
enemyregion: _enemyregion,
enemyimage: _enemyimage,
enemyEvade: _enemyEvadeScore,
enemyAbility: _enemyability,
enemyDesc: _description,
enemyXP: _enemyEXP
}>>
<</silently>>\
<</widget>>\
<<widget "ScaredMerchants">>\
<<silently>>\
<<set _enemyability = []>>
<<set _enemyability.push("attack", "attack")>>
<<set _enemyregion = "Enemy">>
<<set _enemyimage = "Panicked_band_of_merchants">>
<<set _fullname = "Panicked band of merchants">>
<<set _location = ["Jade Creek Town", "Northern Phoenix City", "Blood Sand Reach", "Hundred Sorrows Mountain"].random()>>
<<set _maxhealthNPC = random(240, 250)>>
<<set _maxenergyNPC = random(100, 130)>>
<<set _currenthealthNPC = _maxhealthNPC>>
<<set _currentenergyNPC = _maxenergyNPC>>
<<set _luckNPC = random(1, 5)>>
<<set _insightNPC = random(1, 5)>>
<<set _basestrengthNPC = random(5, 6)>>
<<set _basewillpowerNPC = random(4, 7)>>
<<set _atkNPC = random(4, 10)>>
<<set _defNPC = random(3, 6)>>
<<set _critNPC = random(2, 4)>>
<<set _critresNPC = random(0, 2)>>
<<set _agilityNPC = random(6, 13)>>
<<set _martialArtsNPC = random(0, 2)>>
<<set _enemyEXP = random (20,40)>>
<<set _spiritualRootNPC = random(0, 3)>>
<<set _enemyEvadeScore = (_agilityNPC * 2) + (_insightNPC * 1.5) + (_luckNPC * 0.5)>>
<<set _description = "You see a band of merchants, their faces grim and eyes alert. They carry heavy packs and weapons, clearly not here for leisure.">>
<<set _npc = {
fullname: _fullname,
NPCmaxlifespan: _maxlifespanNPC,
NPClifespan: __lifespanNPC,
NPCmaxhealth: _maxhealthNPC,
NPCmaxenergy: _maxenergyNPC,
NPCcurrenthealth: _currenthealthNPC,
NPCcurrentenergy: _currentenergyNPC,
NPCluck: _luckNPC,
NPCinsight: _insightNPC,
NPCbasestrength: _basestrengthNPC,
NPCbasewillpower: _basewillpowerNPC,
NPCatk: _atkNPC,
NPCdef: _defNPC,
NPCcrit: _critNPC,
NPCcritres: _critresNPC,
NPCagility: _agilityNPC,
NPCmartialArts: _martialArtsNPC,
NPCspiritualRoot: _spiritualRootNPC,
NPClocation: _location,
enemyregion: _enemyregion,
enemyimage: _enemyimage,
enemyEvade: _enemyEvadeScore,
enemyAbility: _enemyability,
enemyDesc: _description,
enemyXP: _enemyEXP
}>>
<</silently>>\
<</widget>>\/*
HerbGather Widget
─────────────────
Usage: <<HerbGather>>
Must be called from inside a region passage that has already set $region.
Expects:
$region — string matching one of the three region names
Item pools are defined per region. Each entry: [itemVariable, itemName, rarity]
rarity: "common" → qty 2–5, "uncommon" → qty 1–3, "rare" → qty 1–2
Random events (per gather attempt):
70% nothing (just gather)
12% beast ambush → placeholder combat hook
8% wandering stranger → cultivator / merchant / sect disciple (random)
7% fox woman encounter → spirit fox spirit, NSFW gated by $corruption
3% rival cultivator → hostile NPC who may fight or leave
NSFW options gated:
$corruption >= 20 → mild flirtatious options visible
$corruption >= 50 → explicit options visible
*/
<<widget "HerbGather">>
/* ── Build region item pool ── */
<<set _pool to []>>
<<if $region is "Blood Sand Reach">>
/* Desert / arid zone — yang-aspected, beast-heavy, harsh */
<<set _pool to [
$burningsandresin,
$sturdygrassfiber,
$duskbloodmoss,
$solarstonepowder,
$bloodhardeningherb,
$thunderweed,
$crimsonhideflake,
$ironbloodlotusseed,
$vitalityroot,
$heartdevilweed
]>>
<<elseif $region is "Hundred Sorrows Mountain">>
/* High altitude — yin-aspected, cold qi, rare meridian herbs */
<<set _pool to [
$stonepulsepebble,
$risingmistherb,
$clearwaterextract,
$emptymindherb,
$moonlightshell,
$serpentpulsesalve,
$cinnabarheartstone,
$stillwaterpearlpowder,
$nineleaflotus,
$moonlitjadefragment,
$agelesspinetwig
]>>
<<elseif $region is "Great Plains">>
/* Open flatlands — balanced qi, common cultivation materials */
<<set _pool to [
$spiritvinetendril,
$qispunsilk,
$lessermeridiandust,
$swiftwindfeather,
$shadowstepmoss,
$rosedewhoney,
$faintqicrystal,
$greenspiritsap,
$breathingmoonmoss,
$fortunemistseed,
$bloodlotuspetal
]>>
<</if>>
/* ── Roll item ── */
<<set _pick to _pool[random(0, _pool.length - 1)]>>
<<set _rarity to _pick.rarity>>
<<if _rarity is "common">>
<<set _qty to random(2, 5)>>
<<elseif _rarity is "uncommon">>
<<set _qty to random(1, 3)>>
<<else>>
<<set _qty to random(1, 2)>>
<</if>>
/* ── Add to inventory using the loop and clone method ── */
<<set _found to false>>
<<set _index to -1>>
<<for _j to 0; _j < $playeriteminventory.length; _j++>>
<<if $playeriteminventory[_j].id === _pick.id>>
<<set _found to true>>
<<set _index to _j>>
<<break>>
<</if>>
<</for>>
<<if _found>>
/* Item exists, add the rolled quantity */
<<set $playeriteminventory[_index].quantity += _qty>>
<<else>>
/* Item does not exist, clone the template and set quantity */
<<set _newItem to clone(_pick)>>
<<set _newItem.quantity to _qty>>
<<set $playeriteminventory.push(_newItem)>>
<</if>>
/* ── Roll event (0–99) ── */
<<set _eventRoll to random(0, 99)>>
<<if _eventRoll lt 70>>
/* ════════════════════════════════
EVENT: Peaceful gather (70%)
════════════════════════════════ */
<<set _flavorPeaceful to [
"The wind stirs the grass around you. Nothing moves but the rustling of leaves.",
"Birdsong fills the air. A good day to gather.",
"You work in silence, hands moving with practiced efficiency.",
"The qi here is thin but steady. You breathe slowly and gather.",
"Clouds drift overhead. No trouble today.",
"A faint spiritual pressure hums beneath the soil — a sign of good herbs.",
"The earth here feels undisturbed. You make the most of it.",
"You lose yourself in the rhythm of searching and plucking.",
"A gentle mist rolls through. You gather undisturbed.",
"Something small skitters away through the grass as you approach. Nothing dangerous."
]>>
<p class="herb-gather-flavor"><<= _flavorPeaceful[random(0, _flavorPeaceful.length - 1)]>></p>
<<elseif _eventRoll lt 82>>
/* ════════════════════════════════
EVENT: Beast ambush (12%)
════════════════════════════════ */
<<set _beastFlavor to [
"The silence shatters. Something lunges from the brush — claws already drawn.",
"You catch the scent of blood a moment too late. A beast crashes through the undergrowth.",
"A guttural growl erupts from the shadows ahead. Your hand moves to your weapon.",
"The air goes cold. You spin to find red eyes watching you from the treeline.",
"Pebbles skitter across stone behind you. An ambush — well laid, poorly timed."
]>>
<p class="herb-gather-flavor"><<= _beastFlavor[random(0, _beastFlavor.length - 1)]>></p>
<p class="herb-gather-event-label">⚔ A beast emerges!</p>
<<BeastsPickFight>>
<<set $combatReturnPassage to passage()>>
<<link "Battle" "HuntBeastsBattle|Region1">><<set $passage to "HuntBeastsBattle|Region1">><<BeforeBattle>><<set $pe=0>><</link>>
<<elseif _eventRoll lt 90>>
/* ════════════════════════════════
EVENT: Wandering stranger (8%)
════════════════════════════════ */
<<set _strangerType to random(0, 2)>>
<<if _strangerType is 0>>
/* Wandering cultivator */
<<set _cultivatorMood to random(0, 1)>>
<p class="herb-gather-flavor">A figure drops from the treetops without a sound — robes dusty from travel, a gourd of spirit wine at their hip. Their eyes sweep over you with the calm assessment of someone who has survived many dangerous places.</p>
<<if _cultivatorMood is 0>>
<p class="herb-gather-flavor">"Gathering alone out here?" they say, glancing at your haul. "Brave or stupid. With a face like that, I'll assume brave." They pause, then toss something small in your direction before vanishing into the treeline.</p>
<<set $meditationdust.quantity += 1>>
<p class="herb-gather-event-label">✦ The cultivator left behind: Meditation Dust ×1</p>
<<link "..." $loopPassage>><</link>>
<<else>>
<p class="herb-gather-flavor">"This area falls under the Iron Cloud Sect's outer patrol route," the cultivator says flatly. "I'd suggest you finish quickly." They do not wait for your response before leaping away.</p>
<p class="herb-gather-event-label">⚑ You have been warned. Gather quickly.</p>
<<link "..." $loopPassage>><</link>>
<</if>>
<<elseif _strangerType is 1>>
/* Traveling merchant */
<p class="herb-gather-flavor">A hunched figure emerges from behind a boulder, laden with bundles and jars clinking softly against each other. A traveling alchemist-merchant, by the look of the herb stains on their fingers.</p>
<p class="herb-gather-flavor"><span class="male">"Ah! A cultivator with a good eye for gathering. I respect that. "</span> They squint at your collection. <span class="male">"I could take some of what you've found off your hands, if the price suits."</span></p>
<p class="herb-gather-event-label">✦ A traveling merchant appeared. They seemed harmless — and oddly well-stocked.</p>
<<link "Keep gathering" $loopPassage>><</link>>
/* TODO: optionally hook into your merchant/shop system here */
<<else>>
/* Sect disciple */
<<set _sectMood to random(0, 1)>>
<p class="herb-gather-flavor">A young cultivator in sect robes steps onto the path ahead, their bearing stiff with the self-importance of someone recently promoted to outer disciple.</p>
<<if _sectMood is 0>>
<p class="herb-gather-flavor">Their eyes land on you and widen. Something shifts — recognition, or perhaps your reputation reaching them before your name does. They mutter something about their senior brothers and hurry off without another word.</p>
<p class="herb-gather-event-label">⚑ They recognized you. Word may spread.</p>
<<link "..." $loopPassage>><</link>>
<<else>>
<p class="herb-gather-flavor"><span class="male">"You dare gather in our sect's territory?"</span> they snap, hand flying to their spirit weapon. Then they seem to reconsider. Their gaze moves over you slowly, and the anger flickers into something more complicated. <span class="male">"...I'll let it go. This once."</span></p>
<p class="herb-gather-event-label">⚑ The disciple backed down — though not without looking you over a little too long.</p>
<<link "..." $loopPassage>><</link>>
<</if>>
<</if>>
<<elseif _eventRoll lt 97>>
/* ════════════════════════════════
EVENT: Fox woman encounter (7%)
════════════════════════════════ */
<<set _foxApproach to random(0, 2)>>
<<if _foxApproach is 0>>
<p class="herb-gather-flavor">You notice her only because she lets you — a woman perched on a low branch above the path, nine silver tails fanning behind her like smoke. Her amber eyes hold the particular amusement of someone who has watched mortals for a very long time.</p>
<p class="herb-gather-flavor">"Little cultivator," she says, voice low and unhurried. "You gather herbs in a demon's garden and don't even leave an offering. How rude."</p>
<<elseif _foxApproach is 1>>
<p class="herb-gather-flavor">The smell reaches you first — something warm and floral and faintly wrong. Then she steps from behind a tree that should not have hidden her, fox ears tilted with curiosity, tails sweeping the grass behind her.</p>
<p class="herb-gather-flavor">"You have good instincts," she says, studying your gathered herbs. "And passable taste. I'll allow your trespassing — for now."</p>
<<else>>
<p class="herb-gather-flavor">A silver fox darts across the path — then shimmers, stretches upward, and becomes a woman with nine tails and an expression of profound boredom. She looks you over without hurry.</p>
<p class="herb-gather-flavor">"A cultivator, all alone." She tilts her head. "Lost, or just foolish?"</p>
<</if>>
<div id="herb-fox-interaction" class="herb-gather-choices">
<<link "Greet her respectfully">>
<<replace "#herb-fox-interaction">>
<p class="herb-gather-flavor">You press your palms together and bow. "This one did not know the land belonged to you, senior. I apologize for the intrusion."</p>
<p class="herb-gather-flavor">She blinks — surprised, perhaps, by the absence of fear. Then she smiles slowly. "Manners. A rare thing." She descends from the branch and circles you once before vanishing in a shimmer of silver. A small token drops from the air where she stood.</p>
<<set $jadegatheringthread.quantity += 1>>
<p class="herb-gather-event-label">✦ She left behind: Jade Gathering Thread ×1</p>
<br>
<<link "..." $loopPassage>><</link>>
<</replace>>
<</link>>
<br>
<<link "Hold your ground and show no weakness">>
<<replace "#herb-fox-interaction">>
<p class="herb-gather-flavor">You meet her amber gaze and don't look away. "I gathered what I came for. I'll leave when I choose."</p>
<p class="herb-gather-flavor">A long pause. Then she laughs — genuine and delighted. "Oh, I like you." She snaps her fingers and a small flame flares between them before guttering out. "Don't make me regret it." She dissolves into the treeline like morning fog.</p>
<p class="herb-gather-event-label">⚑ She seemed amused. You sense you may meet her again.</p>
<br>
<<link "..." $loopPassage>><</link>>
<</replace>>
<</link>>
<br>
<<if $corruption gte 20>>
<<link "Hold her gaze and smile slowly">>
<<replace "#herb-fox-interaction">>
<p class="herb-gather-flavor">You let the silence stretch, then smile. "A demon's garden," you repeat. "Then perhaps I should have brought an offering after all. What would you accept?"</p>
<p class="herb-gather-flavor">Her tails curl. She steps closer — close enough that the warmth radiating off her is unmistakable. "Careful," she murmurs. "You're either very brave or very foolish. I find myself hoping for the latter." She tucks a single silver hair behind your ear and vanishes.</p>
<<set $shadowlustpollen.quantity += 1>>
<p class="herb-gather-event-label">✦ She left something behind: Shadow Lust Pollen ×1</p>
<br>
<<link "..." $loopPassage>><</link>>
<</replace>>
<</link>>
<br>
<</if>>
<<if $corruption gte 50>>
<<link "Step closer — let her see you're not afraid of what she is">>
<<replace "#herb-fox-interaction">>
<p class="herb-gather-flavor">You close the distance slowly, deliberately, watching her ears flick forward in surprise. "I know what you are," you say quietly. "And I'm still here."</p>
<p class="herb-gather-flavor">Something shifts behind her amber eyes. She reaches out and traces one claw lightly along your jaw — not a threat. A test. You don't flinch. She makes a sound low in her throat and steps back, tails curling tight.</p>
<p class="herb-gather-flavor">"Come back tomorrow," she says. "Bring better herbs." She disappears between one blink and the next, leaving only warmth and the scent of silver fox magic on the air.</p>
<<set $foxWomanMet to true>>
<p class="herb-gather-event-label">✦ She issued an invitation. Whether you return is your choice.</p>
/* TODO: optional flag to trigger a follow-up fox woman scene on next visit */
<br>
<<link "..." $loopPassage>><</link>>
<</replace>>
<</link>>
<br>
<</if>>
</div>
<<else>>
/* ════════════════════════════════
EVENT: Rival cultivator (3%)
════════════════════════════════ */
<<set _rivalMood to random(0, 2)>>
<<if _rivalMood is 0>>
/* Hostile — demands herbs */
<p class="herb-gather-flavor">The qi pressure arrives before the person — a concentrated hostility that makes the herbs around you wilt slightly. A cultivator drops from the sky, sword drawn, eyes fixed on your gathered materials.</p>
<p class="herb-gather-flavor">"Hand over the herbs. I have no quarrel with you beyond this."</p>
<p class="herb-gather-event-label">⚔ A rival cultivator demands your gathered herbs!</p>
<div class="herb-gather-choices">
<<link "Refuse and fight">>
<<replace "#herb-rival-response">>
<p class="herb-gather-flavor">You tighten your grip on what you've gathered. "Come take them."</p>
<p class="herb-gather-event-label">⚔ Combat begins!</p>
<<set $combatReturnPassage to passage()>>
<p class="herb-gather-placeholder"></p>
<<link "Keep gathering" $loopPassage>><</link>>
<</replace>>
<</link>>
<br>
<<link "Surrender half your herbs to avoid conflict">>
<<replace "#herb-rival-response">>
<p class="herb-gather-flavor">You toss a portion of your haul at their feet. They snatch it up without thanks and vanish. A bitter trade — but not a fatal one.</p>
<<set $[_pick.id].quantity -= Math.floor(_qty / 2)>>
<p class="herb-gather-event-label">⚑ You lost half your gathered herbs.</p>
<<link "Keep gathering" $loopPassage>><</link>>
<</replace>>
<</link>>
<br>
<<link "Use your reputation to intimidate them">>
<<replace "#herb-rival-response">>
<p class="herb-gather-flavor">You let your qi unfurl — just enough. Your name, your sect, your record. You watch the calculation cross their face. A moment later they sheathe their sword and leave without a word.</p>
<p class="herb-gather-event-label">✦ They backed down. Reputation has its uses.</p>
<<link "Keep gathering" $loopPassage>><</link>>
<</replace>>
<</link>>
</div>
<span id="herb-rival-response"></span>
<<elseif _rivalMood is 1>>
/* Wounded — needs help */
<p class="herb-gather-flavor">A cultivator emerges from the mist, wounded — one arm pressed to their side. They freeze when they see you, then relax fractionally. "You're not one of theirs," they say. It is not a question.</p>
<p class="herb-gather-flavor">They need medical herbs. By coincidence or fate, you have some.</p>
<div class="herb-gather-choices">
<<link "Give them what they need">>
<<replace "#herb-rival-response">>
<p class="herb-gather-flavor">You hand over a portion of your gathering without ceremony. They stare at you for a moment, then nod — the deep kind, the kind that means something. "I won't forget this." They slip back into the mist.</p>
<<set $greenspiritsap.quantity -= 1>>
<p class="herb-gather-event-label">✦ You gave aid. A debt was acknowledged.</p>
<<link "Keep gathering" $loopPassage>><</link>>
/* TODO: optional — set a relationship flag with this NPC */
<</replace>>
<</link>>
<br>
<<link "Demand payment in exchange">>
<<replace "#herb-rival-response">>
<p class="herb-gather-flavor">"Nothing is free," you say. They grimace — then reach into their robes and produce a spirit stone. "Fine." You make the exchange. They disappear without looking back.</p>
<<set $greenspiritsap.quantity -= 1>>
<<set $gold += 30>>
<p class="herb-gather-event-label">✦ You traded herbs for 30 spirit stones.</p>
<<link "Keep gathering" $loopPassage>><</link>>
<</replace>>
<</link>>
<br>
<<link "Leave them to their fate">>
<<replace "#herb-rival-response">>
<p class="herb-gather-flavor">Their problem. You've enough of your own. You pocket your herbs and move on without a word. Behind you, you hear them slide down against rock to rest. They'll live or they won't.</p>
<p class="herb-gather-event-label">⚑ You walked away.</p>
<<link "Keep gathering" $loopPassage>><</link>>
<</replace>>
<</link>>
</div>
<span id="herb-rival-response"></span>
<<else>>
/* Fleeing something worse */
<p class="herb-gather-flavor">You hear them before you see them — a cultivator sprinting through the undergrowth, panic written plainly across their face. They skid to a halt when they nearly collide with you.</p>
<p class="herb-gather-flavor">"Move," they gasp. "Something is following me. Something big." They don't wait — they vault over a boulder and vanish into the distance.</p>
<p class="herb-gather-flavor">A moment later, you hear it too. Heavy footsteps. Getting closer.</p>
<p class="herb-gather-event-label">⚔ Whatever they were fleeing has found you now.</p>
<<BeastsPickFight>>
<<set $combatReturnPassage to passage()>>
<<link "Battle" "HuntBeastsBattle|Region1">><<set $passage to "HuntBeastsBattle|Region1">><<BeforeBattle>><<set $pe=0>><</link>>
<</if>>
<</if>>
/* ── Always show what was gathered ── */
<hr class="herb-divider">
<p class="herb-gather-result">You gathered: <strong><<= _pick.name>> ×<<= _qty>></strong>
<<if _rarity is "rare">> <span class="herb-rarity-rare">(Rare)</span>
<<elseif _rarity is "uncommon">> <span class="herb-rarity-uncommon">(Uncommon)</span>
<</if>>
</p>
<</widget>><<BeastsPickFight>>
_description
<<link "Run away before _fullname sees you!" "Map|Region1">> <</link>>
<<link "Fall back and try to hunt different beast" "HuntBeasts|Region1">> <</link>>
<<link "Battle" "HuntBeastsBattle|Region1">><<set $passage to "HuntBeastsBattle|Region1">><<BeforeBattle>><<set $pe=0>><</link>><<widget "BeastsPickFight">>
<<if $region eq "Hundred Sorrows Mountain">>
<<set _roll = ["FrostclawBear", "MistVeilCrane", "SorrowPeakApe", "GlacialSerpentElder"].random()>>
<<if _roll eq "FrostclawBear">><<FrostclawBear>>
<<elseif _roll eq "MistVeilCrane">><<MistVeilCrane>>
<<elseif _roll eq "SorrowPeakApe">><<SorrowPeakApe>>
<<elseif _roll eq "GlacialSerpentElder">><<GlacialSerpentElder>>
<</if>>
<<elseif $region eq "Blood Sand Reach">>
<<set _roll = ["SandscorchLizard", "DuneStriderOx", "BloodSandScorpion", "YangFlameFox"].random()>>
<<if _roll eq "SandscorchLizard">><<SandscorchLizard>>
<<elseif _roll eq "DuneStriderOx">><<DuneStriderOx>>
<<elseif _roll eq "BloodSandScorpion">><<BloodSandScorpion>>
<<elseif _roll eq "YangFlameFox">><<YangFlameFox>>
<</if>>
<<elseif $region eq "Great Plains">>
<<set _roll = ["WindhareSpirit", "PlainsStoneback", "GrasswhipSerpent", "MudwolfPack"].random()>>
<<if _roll eq "WindhareSpirit">><<WindhareSpirit>>
<<elseif _roll eq "PlainsStoneback">><<PlainsStoneback>>
<<elseif _roll eq "GrasswhipSerpent">><<GrasswhipSerpent>>
<<elseif _roll eq "MudwolfPack">><<MudwolfPack>>
<</if>>
<<endif>>
<</widget>>
/* ══════════════════════════════════════════════════════
GREAT PLAINS BEASTS — Weak to Medium (early game)
══════════════════════════════════════════════════════ */
<<widget "WindhareSpirit">>\
<<silently>>\
<<set _enemyability = []>>
<<set _enemyability.push("attack", "evade")>>
<<set _enemyregion = "Enemy">>
<<set _enemyimage = "Windhare Spirit">>
<<set _fullname = "Windhare Spirit">>
<<set _location = "Great Plains">>
<<set _maxhealthNPC = random(80, 130)>>
<<set _maxenergyNPC = random(40, 60)>>
<<set _currenthealthNPC = _maxhealthNPC>>
<<set _currentenergyNPC = _maxenergyNPC>>
<<set _luckNPC = random(4, 8)>>
<<set _insightNPC = random(3, 6)>>
<<set _basestrengthNPC = random(2, 4)>>
<<set _basewillpowerNPC = random(1, 3)>>
<<set _atkNPC = random(3, 7)>>
<<set _defNPC = random(1, 4)>>
<<set _critNPC = random(1, 3)>>
<<set _critresNPC = random(0, 1)>>
<<set _agilityNPC = random(10, 16)>>
<<set _martialArtsNPC = random(0, 1)>>
<<set _enemyEXP = random(155, 222)>>
<<set _spiritualRootNPC = random(0, 2)>>
<<set _enemyEvadeScore = (_agilityNPC * 2) + (_insightNPC * 1.5) + (_luckNPC * 0.5)>>
<<set _loot = [
{item: $swiftwindfeather, chance: 60},
{item: $risingmistherb, chance: 40},
{item: $lessermeridiandust, chance: 25}
]>>
<<set _description = "A hare the size of a dog, its fur rippling with visible wind currents. It watches you with unnervingly keen eyes before darting sideways — faster than something this small has any right to be.">>
<<set _npc = {
fullname: _fullname,
NPCmaxhealth: _maxhealthNPC,
NPCmaxenergy: _maxenergyNPC,
NPCcurrenthealth: _currenthealthNPC,
NPCcurrentenergy: _currentenergyNPC,
NPCluck: _luckNPC,
NPCinsight: _insightNPC,
NPCbasestrength: _basestrengthNPC,
NPCbasewillpower: _basewillpowerNPC,
NPCatk: _atkNPC,
NPCdef: _defNPC,
NPCcrit: _critNPC,
NPCcritres: _critresNPC,
NPCagility: _agilityNPC,
NPCmartialArts: _martialArtsNPC,
NPCspiritualRoot: _spiritualRootNPC,
NPClocation: _location,
enemyregion: _enemyregion,
enemyimage: _enemyimage,
enemyEvade: _enemyEvadeScore,
enemyAbility: _enemyability,
enemyDesc: _description,
enemyXP: _enemyEXP,
enemyLoot: _loot
}>>
<</silently>>\
<</widget>>\
<<widget "PlainsStoneback">>\
<<silently>>\
<<set _enemyability = []>>
<<set _enemyability.push("attack", "attack", "defend")>>
<<set _enemyregion = "Enemy">>
<<set _enemyimage = "Plains Stoneback">>
<<set _fullname = "Plains Stoneback">>
<<set _location = "Great Plains">>
<<set _maxhealthNPC = random(160, 220)>>
<<set _maxenergyNPC = random(50, 80)>>
<<set _currenthealthNPC = _maxhealthNPC>>
<<set _currentenergyNPC = _maxenergyNPC>>
<<set _luckNPC = random(1, 3)>>
<<set _insightNPC = random(1, 3)>>
<<set _basestrengthNPC = random(5, 8)>>
<<set _basewillpowerNPC = random(2, 4)>>
<<set _atkNPC = random(5, 10)>>
<<set _defNPC = random(8, 14)>>
<<set _critNPC = random(1, 2)>>
<<set _critresNPC = random(1, 3)>>
<<set _agilityNPC = random(2, 5)>>
<<set _martialArtsNPC = random(0, 1)>>
<<set _enemyEXP = random(190, 240)>>
<<set _spiritualRootNPC = random(0, 1)>>
<<set _enemyEvadeScore = (_agilityNPC * 2) + (_insightNPC * 1.5) + (_luckNPC * 0.5)>>
<<set _loot = [
{item: $sturdygrassfiber, chance: 65},
{item: $temperedbonefragment, chance: 45},
{item: $beastsinewfiber, chance: 30}
]>>
<<set _description = "A heavy tortoise-like beast with a shell of compressed earth and stone. It moves slowly and without fear — the kind of creature that has never needed to run from anything.">>
<<set _npc = {
fullname: _fullname,
NPCmaxhealth: _maxhealthNPC,
NPCmaxenergy: _maxenergyNPC,
NPCcurrenthealth: _currenthealthNPC,
NPCcurrentenergy: _currentenergyNPC,
NPCluck: _luckNPC,
NPCinsight: _insightNPC,
NPCbasestrength: _basestrengthNPC,
NPCbasewillpower: _basewillpowerNPC,
NPCatk: _atkNPC,
NPCdef: _defNPC,
NPCcrit: _critNPC,
NPCcritres: _critresNPC,
NPCagility: _agilityNPC,
NPCmartialArts: _martialArtsNPC,
NPCspiritualRoot: _spiritualRootNPC,
NPClocation: _location,
enemyregion: _enemyregion,
enemyimage: _enemyimage,
enemyEvade: _enemyEvadeScore,
enemyAbility: _enemyability,
enemyDesc: _description,
enemyXP: _enemyEXP,
enemyLoot: _loot
}>>
<</silently>>\
<</widget>>\
<<widget "GrasswhipSerpent">>\
<<silently>>\
<<set _enemyability = []>>
<<set _enemyability.push("attack", "attack", "evade")>>
<<set _enemyregion = "Enemy">>
<<set _enemyimage = "Grasswhip Serpent">>
<<set _fullname = "Grasswhip Serpent">>
<<set _location = "Great Plains">>
<<set _maxhealthNPC = random(120, 170)>>
<<set _maxenergyNPC = random(60, 90)>>
<<set _currenthealthNPC = _maxhealthNPC>>
<<set _currentenergyNPC = _maxenergyNPC>>
<<set _luckNPC = random(2, 5)>>
<<set _insightNPC = random(3, 6)>>
<<set _basestrengthNPC = random(4, 7)>>
<<set _basewillpowerNPC = random(2, 4)>>
<<set _atkNPC = random(7, 13)>>
<<set _defNPC = random(3, 7)>>
<<set _critNPC = random(2, 5)>>
<<set _critresNPC = random(0, 2)>>
<<set _agilityNPC = random(7, 12)>>
<<set _martialArtsNPC = random(0, 2)>>
<<set _enemyEXP = random(222, 266)>>
<<set _spiritualRootNPC = random(0, 2)>>
<<set _enemyEvadeScore = (_agilityNPC * 2) + (_insightNPC * 1.5) + (_luckNPC * 0.5)>>
<<set _loot = [
{item: $serpentpulsesalve, chance: 55},
{item: $serpentmarkscale, chance: 30},
{item: $windveinpowder, chance: 20}
]>>
<<set _description = "A long serpent that blends perfectly into the tall grass, visible only as a ripple of displaced air. It strikes with the crack of a whip — twice before you've registered the first blow.">>
<<set _npc = {
fullname: _fullname,
NPCmaxhealth: _maxhealthNPC,
NPCmaxenergy: _maxenergyNPC,
NPCcurrenthealth: _currenthealthNPC,
NPCcurrentenergy: _currentenergyNPC,
NPCluck: _luckNPC,
NPCinsight: _insightNPC,
NPCbasestrength: _basestrengthNPC,
NPCbasewillpower: _basewillpowerNPC,
NPCatk: _atkNPC,
NPCdef: _defNPC,
NPCcrit: _critNPC,
NPCcritres: _critresNPC,
NPCagility: _agilityNPC,
NPCmartialArts: _martialArtsNPC,
NPCspiritualRoot: _spiritualRootNPC,
NPClocation: _location,
enemyregion: _enemyregion,
enemyimage: _enemyimage,
enemyEvade: _enemyEvadeScore,
enemyAbility: _enemyability,
enemyDesc: _description,
enemyXP: _enemyEXP,
enemyLoot: _loot
}>>
<</silently>>\
<</widget>>\
<<widget "MudwolfPack">>\
<<silently>>\
<<set _enemyability = []>>
<<set _enemyability.push("attack", "attack", "attack")>>
<<set _enemyregion = "Enemy">>
<<set _enemyimage = "Mudwolf Pack">>
<<set _fullname = "Mudwolf Pack">>
<<set _location = "Great Plains">>
<<set _maxhealthNPC = random(200, 270)>>
<<set _maxenergyNPC = random(70, 100)>>
<<set _currenthealthNPC = _maxhealthNPC>>
<<set _currentenergyNPC = _maxenergyNPC>>
<<set _luckNPC = random(2, 5)>>
<<set _insightNPC = random(4, 7)>>
<<set _basestrengthNPC = random(5, 9)>>
<<set _basewillpowerNPC = random(3, 5)>>
<<set _atkNPC = random(9, 16)>>
<<set _defNPC = random(4, 8)>>
<<set _critNPC = random(2, 4)>>
<<set _critresNPC = random(0, 2)>>
<<set _agilityNPC = random(6, 10)>>
<<set _martialArtsNPC = random(1, 3)>>
<<set _enemyEXP = random(280, 300)>>
<<set _spiritualRootNPC = random(0, 2)>>
<<set _enemyEvadeScore = (_agilityNPC * 2) + (_insightNPC * 1.5) + (_luckNPC * 0.5)>>
<<set _loot = [
{item: $beastsinewfiber, chance: 60},
{item: $bloodhardeningherb, chance: 35},
{item: $flowrootessence, chance: 20}
]>>
<<set _description = "Three mudwolves circle you without sound, their coats matted with dried earth that hardens their flanks like crude armor. They don't rush. They wait for the gap.">>
<<set _npc = {
fullname: _fullname,
NPCmaxhealth: _maxhealthNPC,
NPCmaxenergy: _maxenergyNPC,
NPCcurrenthealth: _currenthealthNPC,
NPCcurrentenergy: _currentenergyNPC,
NPCluck: _luckNPC,
NPCinsight: _insightNPC,
NPCbasestrength: _basestrengthNPC,
NPCbasewillpower: _basewillpowerNPC,
NPCatk: _atkNPC,
NPCdef: _defNPC,
NPCcrit: _critNPC,
NPCcritres: _critresNPC,
NPCagility: _agilityNPC,
NPCmartialArts: _martialArtsNPC,
NPCspiritualRoot: _spiritualRootNPC,
NPClocation: _location,
enemyregion: _enemyregion,
enemyimage: _enemyimage,
enemyEvade: _enemyEvadeScore,
enemyAbility: _enemyability,
enemyDesc: _description,
enemyXP: _enemyEXP,
enemyLoot: _loot
}>>
<</silently>>\
<</widget>>\
/* ══════════════════════════════════════════════════════
BLOOD SAND REACH BEASTS — Medium (early-mid game)
══════════════════════════════════════════════════════ */
<<widget "SandscorchLizard">>\
<<silently>>\
<<set _enemyability = []>>
<<set _enemyability.push("attack", "attack", "defend")>>
<<set _enemyregion = "Enemy">>
<<set _enemyimage = "Sandscorch Lizard">>
<<set _fullname = "Sandscorch Lizard">>
<<set _location = "Blood Sand Reach">>
<<set _maxhealthNPC = random(180, 250)>>
<<set _maxenergyNPC = random(70, 110)>>
<<set _currenthealthNPC = _maxhealthNPC>>
<<set _currentenergyNPC = _maxenergyNPC>>
<<set _luckNPC = random(1, 4)>>
<<set _insightNPC = random(2, 5)>>
<<set _basestrengthNPC = random(6, 9)>>
<<set _basewillpowerNPC = random(2, 5)>>
<<set _atkNPC = random(10, 18)>>
<<set _defNPC = random(10, 16)>>
<<set _critNPC = random(2, 4)>>
<<set _critresNPC = random(1, 3)>>
<<set _agilityNPC = random(4, 8)>>
<<set _martialArtsNPC = random(0, 2)>>
<<set _enemyEXP = random(180, 280)>>
<<set _spiritualRootNPC = random(0, 2)>>
<<set _enemyEvadeScore = (_agilityNPC * 2) + (_insightNPC * 1.5) + (_luckNPC * 0.5)>>
<<set _loot = [
{item: $thunderlizardhide, chance: 55},
{item: $burningsandresin, chance: 50},
{item: $copperskinpowder, chance: 35}
]>>
<<set _description = "A broad, flat lizard whose scales have been scorched to near-ceramic hardness by years under the blood sun. Heat shimmer rises from its back. When it opens its mouth, you see embers.">>
<<set _npc = {
fullname: _fullname,
NPCmaxhealth: _maxhealthNPC,
NPCmaxenergy: _maxenergyNPC,
NPCcurrenthealth: _currenthealthNPC,
NPCcurrentenergy: _currentenergyNPC,
NPCluck: _luckNPC,
NPCinsight: _insightNPC,
NPCbasestrength: _basestrengthNPC,
NPCbasewillpower: _basewillpowerNPC,
NPCatk: _atkNPC,
NPCdef: _defNPC,
NPCcrit: _critNPC,
NPCcritres: _critresNPC,
NPCagility: _agilityNPC,
NPCmartialArts: _martialArtsNPC,
NPCspiritualRoot: _spiritualRootNPC,
NPClocation: _location,
enemyregion: _enemyregion,
enemyimage: _enemyimage,
enemyEvade: _enemyEvadeScore,
enemyAbility: _enemyability,
enemyDesc: _description,
enemyXP: _enemyEXP,
enemyLoot: _loot
}>>
<</silently>>\
<</widget>>\
<<widget "DuneStriderOx">>\
<<silently>>\
<<set _enemyability = []>>
<<set _enemyability.push("attack", "attack", "attack", "defend")>>
<<set _enemyregion = "Enemy">>
<<set _enemyimage = "Dune Strider Ox">>
<<set _fullname = "Dune Strider Ox">>
<<set _location = "Blood Sand Reach">>
<<set _maxhealthNPC = random(280, 370)>>
<<set _maxenergyNPC = random(80, 120)>>
<<set _currenthealthNPC = _maxhealthNPC>>
<<set _currentenergyNPC = _maxenergyNPC>>
<<set _luckNPC = random(1, 3)>>
<<set _insightNPC = random(1, 3)>>
<<set _basestrengthNPC = random(9, 13)>>
<<set _basewillpowerNPC = random(3, 6)>>
<<set _atkNPC = random(13, 22)>>
<<set _defNPC = random(11, 18)>>
<<set _critNPC = random(1, 3)>>
<<set _critresNPC = random(2, 5)>>
<<set _agilityNPC = random(3, 6)>>
<<set _martialArtsNPC = random(0, 2)>>
<<set _enemyEXP = random(250, 400)>>
<<set _spiritualRootNPC = random(0, 2)>>
<<set _enemyEvadeScore = (_agilityNPC * 2) + (_insightNPC * 1.5) + (_luckNPC * 0.5)>>
<<set _loot = [
{item: $mountainoxtendon, chance: 50},
{item: $beastsinewfiber, chance: 55},
{item: $ironcorehusk, chance: 30},
{item: $vitalityroot, chance: 20}
]>>
<<set _description = "A massive bovine beast with iron-dense horns and hooves that crack stone with every step. Its hide is layered like overlapping plates. It has no particular interest in you — until it does.">>
<<set _npc = {
fullname: _fullname,
NPCmaxhealth: _maxhealthNPC,
NPCmaxenergy: _maxenergyNPC,
NPCcurrenthealth: _currenthealthNPC,
NPCcurrentenergy: _currentenergyNPC,
NPCluck: _luckNPC,
NPCinsight: _insightNPC,
NPCbasestrength: _basestrengthNPC,
NPCbasewillpower: _basewillpowerNPC,
NPCatk: _atkNPC,
NPCdef: _defNPC,
NPCcrit: _critNPC,
NPCcritres: _critresNPC,
NPCagility: _agilityNPC,
NPCmartialArts: _martialArtsNPC,
NPCspiritualRoot: _spiritualRootNPC,
NPClocation: _location,
enemyregion: _enemyregion,
enemyimage: _enemyimage,
enemyEvade: _enemyEvadeScore,
enemyAbility: _enemyability,
enemyDesc: _description,
enemyXP: _enemyEXP,
enemyLoot: _loot
}>>
<</silently>>\
<</widget>>\
<<widget "BloodSandScorpion">>\
<<silently>>\
<<set _enemyability = []>>
<<set _enemyability.push("attack", "attack", "evade", "attack")>>
<<set _enemyregion = "Enemy">>
<<set _enemyimage = "Blood Sand Scorpion">>
<<set _fullname = "Blood Sand Scorpion">>
<<set _location = "Blood Sand Reach">>
<<set _maxhealthNPC = random(220, 300)>>
<<set _maxenergyNPC = random(90, 130)>>
<<set _currenthealthNPC = _maxhealthNPC>>
<<set _currentenergyNPC = _maxenergyNPC>>
<<set _luckNPC = random(2, 5)>>
<<set _insightNPC = random(3, 6)>>
<<set _basestrengthNPC = random(7, 11)>>
<<set _basewillpowerNPC = random(3, 6)>>
<<set _atkNPC = random(14, 24)>>
<<set _defNPC = random(8, 14)>>
<<set _critNPC = random(3, 6)>>
<<set _critresNPC = random(1, 3)>>
<<set _agilityNPC = random(7, 12)>>
<<set _martialArtsNPC = random(1, 3)>>
<<set _enemyEXP = random(280, 420)>>
<<set _spiritualRootNPC = random(1, 3)>>
<<set _enemyEvadeScore = (_agilityNPC * 2) + (_insightNPC * 1.5) + (_luckNPC * 0.5)>>
<<set _loot = [
{item: $duskbloodmoss, chance: 50},
{item: $crimsonhideflake, chance: 45},
{item: $innerflamecore, chance: 25},
{item: $ironbloodlotusseed, chance: 15}
]>>
<<set _description = "A scorpion the size of a dog, its carapace the deep red of old blood. Its stinger drips something that sizzles when it hits the sand. It moves in sudden, unpredictable bursts.">>
<<set _npc = {
fullname: _fullname,
NPCmaxhealth: _maxhealthNPC,
NPCmaxenergy: _maxenergyNPC,
NPCcurrenthealth: _currenthealthNPC,
NPCcurrentenergy: _currentenergyNPC,
NPCluck: _luckNPC,
NPCinsight: _insightNPC,
NPCbasestrength: _basestrengthNPC,
NPCbasewillpower: _basewillpowerNPC,
NPCatk: _atkNPC,
NPCdef: _defNPC,
NPCcrit: _critNPC,
NPCcritres: _critresNPC,
NPCagility: _agilityNPC,
NPCmartialArts: _martialArtsNPC,
NPCspiritualRoot: _spiritualRootNPC,
NPClocation: _location,
enemyregion: _enemyregion,
enemyimage: _enemyimage,
enemyEvade: _enemyEvadeScore,
enemyAbility: _enemyability,
enemyDesc: _description,
enemyXP: _enemyEXP,
enemyLoot: _loot
}>>
<</silently>>\
<</widget>>\
<<widget "YangFlameFox">>\
<<silently>>\
<<set _enemyability = []>>
<<set _enemyability.push("attack", "attack", "evade", "attack")>>
<<set _enemyregion = "Enemy">>
<<set _enemyimage = "Yang Flame Fox">>
<<set _fullname = "Yang Flame Fox">>
<<set _location = "Blood Sand Reach">>
<<set _maxhealthNPC = random(200, 270)>>
<<set _maxenergyNPC = random(110, 150)>>
<<set _currenthealthNPC = _maxhealthNPC>>
<<set _currentenergyNPC = _maxenergyNPC>>
<<set _luckNPC = random(3, 6)>>
<<set _insightNPC = random(4, 7)>>
<<set _basestrengthNPC = random(6, 9)>>
<<set _basewillpowerNPC = random(4, 7)>>
<<set _atkNPC = random(12, 20)>>
<<set _defNPC = random(5, 10)>>
<<set _critNPC = random(4, 7)>>
<<set _critresNPC = random(1, 3)>>
<<set _agilityNPC = random(9, 14)>>
<<set _martialArtsNPC = random(2, 4)>>
<<set _enemyEXP = random(300, 450)>>
<<set _spiritualRootNPC = random(2, 5)>>
<<set _enemyEvadeScore = (_agilityNPC * 2) + (_insightNPC * 1.5) + (_luckNPC * 0.5)>>
<<set _loot = [
{item: $solarstonepowder, chance: 50},
{item: $innerflamecore, chance: 45},
{item: $heartdevilweed, chance: 20},
{item: $sunheartbark, chance: 20}
]>>
<<set _description = "A three-tailed fox with fur the color of ignited coal. Its paws leave scorched prints in the sand and its eyes burn a steady, patient amber. It looks like it is enjoying this.">>
<<set _npc = {
fullname: _fullname,
NPCmaxhealth: _maxhealthNPC,
NPCmaxenergy: _maxenergyNPC,
NPCcurrenthealth: _currenthealthNPC,
NPCcurrentenergy: _currentenergyNPC,
NPCluck: _luckNPC,
NPCinsight: _insightNPC,
NPCbasestrength: _basestrengthNPC,
NPCbasewillpower: _basewillpowerNPC,
NPCatk: _atkNPC,
NPCdef: _defNPC,
NPCcrit: _critNPC,
NPCcritres: _critresNPC,
NPCagility: _agilityNPC,
NPCmartialArts: _martialArtsNPC,
NPCspiritualRoot: _spiritualRootNPC,
NPClocation: _location,
enemyregion: _enemyregion,
enemyimage: _enemyimage,
enemyEvade: _enemyEvadeScore,
enemyAbility: _enemyability,
enemyDesc: _description,
enemyXP: _enemyEXP,
enemyLoot: _loot
}>>
<</silently>>\
<</widget>>\
/* ══════════════════════════════════════════════════════
HUNDRED SORROWS MOUNTAIN BEASTS — Medium-Strong (mid game)
══════════════════════════════════════════════════════ */
<<widget "FrostclawBear">>\
<<silently>>\
<<set _enemyability = []>>
<<set _enemyability.push("attack", "attack", "defend", "attack")>>
<<set _enemyregion = "Enemy">>
<<set _enemyimage = "Frostclaw Bear">>
<<set _fullname = "Frostclaw Bear">>
<<set _location = "Hundred Sorrows Mountain">>
<<set _maxhealthNPC = random(300, 400)>>
<<set _maxenergyNPC = random(100, 140)>>
<<set _currenthealthNPC = _maxhealthNPC>>
<<set _currentenergyNPC = _maxenergyNPC>>
<<set _luckNPC = random(1, 3)>>
<<set _insightNPC = random(2, 4)>>
<<set _basestrengthNPC = random(10, 14)>>
<<set _basewillpowerNPC = random(4, 7)>>
<<set _atkNPC = random(15, 26)>>
<<set _defNPC = random(13, 20)>>
<<set _critNPC = random(2, 4)>>
<<set _critresNPC = random(3, 6)>>
<<set _agilityNPC = random(3, 7)>>
<<set _martialArtsNPC = random(1, 3)>>
<<set _enemyEXP = random(305, 550)>>
<<set _spiritualRootNPC = random(1, 3)>>
<<set _enemyEvadeScore = (_agilityNPC * 2) + (_insightNPC * 1.5) + (_luckNPC * 0.5)>>
<<set _loot = [
{item: $goldenmarrowfragment, chance: 35},
{item: $beastsinewfiber, chance: 55},
{item: $mountainoxtendon, chance: 30},
{item: $clearwaterextract, chance: 25}
]>>
<<set _description = "A massive bear whose claws are permanently encased in a sheath of icy qi. Frost spreads from each pawfall. Its breath comes in visible plumes and it regards you with the calm of a creature that has never lost a fight on this mountain.">>
<<set _npc = {
fullname: _fullname,
NPCmaxhealth: _maxhealthNPC,
NPCmaxenergy: _maxenergyNPC,
NPCcurrenthealth: _currenthealthNPC,
NPCcurrentenergy: _currentenergyNPC,
NPCluck: _luckNPC,
NPCinsight: _insightNPC,
NPCbasestrength: _basestrengthNPC,
NPCbasewillpower: _basewillpowerNPC,
NPCatk: _atkNPC,
NPCdef: _defNPC,
NPCcrit: _critNPC,
NPCcritres: _critresNPC,
NPCagility: _agilityNPC,
NPCmartialArts: _martialArtsNPC,
NPCspiritualRoot: _spiritualRootNPC,
NPClocation: _location,
enemyregion: _enemyregion,
enemyimage: _enemyimage,
enemyEvade: _enemyEvadeScore,
enemyAbility: _enemyability,
enemyDesc: _description,
enemyXP: _enemyEXP,
enemyLoot: _loot
}>>
<</silently>>\
<</widget>>\
<<widget "MistVeilCrane">>\
<<silently>>\
<<set _enemyability = []>>
<<set _enemyability.push("attack", "evade", "attack", "evade")>>
<<set _enemyregion = "Enemy">>
<<set _enemyimage = "Mist Veil Crane">>
<<set _fullname = "Mist Veil Crane">>
<<set _location = "Hundred Sorrows Mountain">>
<<set _maxhealthNPC = random(210, 280)>>
<<set _maxenergyNPC = random(130, 180)>>
<<set _currenthealthNPC = _maxhealthNPC>>
<<set _currentenergyNPC = _maxenergyNPC>>
<<set _luckNPC = random(4, 7)>>
<<set _insightNPC = random(6, 10)>>
<<set _basestrengthNPC = random(5, 8)>>
<<set _basewillpowerNPC = random(5, 9)>>
<<set _atkNPC = random(12, 20)>>
<<set _defNPC = random(6, 11)>>
<<set _critNPC = random(4, 7)>>
<<set _critresNPC = random(2, 4)>>
<<set _agilityNPC = random(11, 17)>>
<<set _martialArtsNPC = random(2, 5)>>
<<set _enemyEXP = random(320, 500)>>
<<set _spiritualRootNPC = random(3, 6)>>
<<set _enemyEvadeScore = (_agilityNPC * 2) + (_insightNPC * 1.5) + (_luckNPC * 0.5)>>
<<set _loot = [
{item: $moonlightshell, chance: 45},
{item: $swiftwindfeather, chance: 50},
{item: $lightningsteptendon, chance: 20},
{item: $meditationdust, chance: 30}
]>>
<<set _description = "A white crane that stands taller than a man, its feathers perpetually wreathed in mountain mist. It does not attack clumsily — every movement is a practiced technique, precise and devastating.">>
<<set _npc = {
fullname: _fullname,
NPCmaxhealth: _maxhealthNPC,
NPCmaxenergy: _maxenergyNPC,
NPCcurrenthealth: _currenthealthNPC,
NPCcurrentenergy: _currentenergyNPC,
NPCluck: _luckNPC,
NPCinsight: _insightNPC,
NPCbasestrength: _basestrengthNPC,
NPCbasewillpower: _basewillpowerNPC,
NPCatk: _atkNPC,
NPCdef: _defNPC,
NPCcrit: _critNPC,
NPCcritres: _critresNPC,
NPCagility: _agilityNPC,
NPCmartialArts: _martialArtsNPC,
NPCspiritualRoot: _spiritualRootNPC,
NPClocation: _location,
enemyregion: _enemyregion,
enemyimage: _enemyimage,
enemyEvade: _enemyEvadeScore,
enemyAbility: _enemyability,
enemyDesc: _description,
enemyXP: _enemyEXP,
enemyLoot: _loot
}>>
<</silently>>\
<</widget>>\
<<widget "SorrowPeakApe">>\
<<silently>>\
<<set _enemyability = []>>
<<set _enemyability.push("attack", "attack", "attack", "defend", "attack")>>
<<set _enemyregion = "Enemy">>
<<set _enemyimage = "Sorrow Peak Ape">>
<<set _fullname = "Sorrow Peak Ape">>
<<set _location = "Hundred Sorrows Mountain">>
<<set _maxhealthNPC = random(340, 450)>>
<<set _maxenergyNPC = random(120, 160)>>
<<set _currenthealthNPC = _maxhealthNPC>>
<<set _currentenergyNPC = _maxenergyNPC>>
<<set _luckNPC = random(1, 4)>>
<<set _insightNPC = random(3, 6)>>
<<set _basestrengthNPC = random(12, 16)>>
<<set _basewillpowerNPC = random(4, 7)>>
<<set _atkNPC = random(18, 30)>>
<<set _defNPC = random(12, 19)>>
<<set _critNPC = random(2, 5)>>
<<set _critresNPC = random(3, 6)>>
<<set _agilityNPC = random(5, 9)>>
<<set _martialArtsNPC = random(2, 5)>>
<<set _enemyEXP = random(240, 350)>>
<<set _spiritualRootNPC = random(1, 4)>>
<<set _enemyEvadeScore = (_agilityNPC * 2) + (_insightNPC * 1.5) + (_luckNPC * 0.5)>>
<<set _loot = [
{item: $titanapehair, chance: 40},
{item: $goldenmarrowfragment, chance: 30},
{item: $beastsinewfiber, chance: 60},
{item: $stonepulsepebble, chance: 30}
]>>
<<set _description = "A great silver-furred ape that haunts the upper ridges of Hundred Sorrows Mountain. Its arms are longer than they should be. When it beats its chest, stones crack in the echo. Cultivators who underestimate it do not make the mistake twice.">>
<<set _npc = {
fullname: _fullname,
NPCmaxhealth: _maxhealthNPC,
NPCmaxenergy: _maxenergyNPC,
NPCcurrenthealth: _currenthealthNPC,
NPCcurrentenergy: _currentenergyNPC,
NPCluck: _luckNPC,
NPCinsight: _insightNPC,
NPCbasestrength: _basestrengthNPC,
NPCbasewillpower: _basewillpowerNPC,
NPCatk: _atkNPC,
NPCdef: _defNPC,
NPCcrit: _critNPC,
NPCcritres: _critresNPC,
NPCagility: _agilityNPC,
NPCmartialArts: _martialArtsNPC,
NPCspiritualRoot: _spiritualRootNPC,
NPClocation: _location,
enemyregion: _enemyregion,
enemyimage: _enemyimage,
enemyEvade: _enemyEvadeScore,
enemyAbility: _enemyability,
enemyDesc: _description,
enemyXP: _enemyEXP,
enemyLoot: _loot
}>>
<</silently>>\
<</widget>>\
<<widget "GlacialSerpentElder">>\
<<silently>>\
<<set _enemyability = []>>
<<set _enemyability.push("attack", "attack", "evade", "attack", "defend")>>
<<set _enemyregion = "Enemy">>
<<set _enemyimage = "Glacial Serpent Elder">>
<<set _fullname = "Glacial Serpent Elder">>
<<set _location = "Hundred Sorrows Mountain">>
<<set _maxhealthNPC = random(370, 480)>>
<<set _maxenergyNPC = random(150, 200)>>
<<set _currenthealthNPC = _maxhealthNPC>>
<<set _currentenergyNPC = _maxenergyNPC>>
<<set _luckNPC = random(2, 5)>>
<<set _insightNPC = random(5, 9)>>
<<set _basestrengthNPC = random(10, 14)>>
<<set _basewillpowerNPC = random(6, 10)>>
<<set _atkNPC = random(17, 28)>>
<<set _defNPC = random(10, 17)>>
<<set _critNPC = random(4, 8)>>
<<set _critresNPC = random(2, 5)>>
<<set _agilityNPC = random(8, 13)>>
<<set _martialArtsNPC = random(3, 6)>>
<<set _enemyEXP = random(245, 370)>>
<<set _spiritualRootNPC = random(3, 6)>>
<<set _enemyEvadeScore = (_agilityNPC * 2) + (_insightNPC * 1.5) + (_luckNPC * 0.5)>>
<<set _loot = [
{item: $serpentmarkscale, chance: 45},
{item: $nineleaflotus, chance: 25},
{item: $moonlitjadefragment, chance: 20},
{item: $riverpearlscale, chance: 20},
{item: $serpentpulsesalve, chance: 40}
]>>
<<set _description = "An ancient serpent more than twenty meters long, its scales a deep glacial blue that glints like cut ice. It has coiled around this particular peak for so long that moss grows on its upper rings. Its qi pressure alone makes the air hard to breathe.">>
<<set _npc = {
fullname: _fullname,
NPCmaxhealth: _maxhealthNPC,
NPCmaxenergy: _maxenergyNPC,
NPCcurrenthealth: _currenthealthNPC,
NPCcurrentenergy: _currentenergyNPC,
NPCluck: _luckNPC,
NPCinsight: _insightNPC,
NPCbasestrength: _basestrengthNPC,
NPCbasewillpower: _basewillpowerNPC,
NPCatk: _atkNPC,
NPCdef: _defNPC,
NPCcrit: _critNPC,
NPCcritres: _critresNPC,
NPCagility: _agilityNPC,
NPCmartialArts: _martialArtsNPC,
NPCspiritualRoot: _spiritualRootNPC,
NPClocation: _location,
enemyregion: _enemyregion,
enemyimage: _enemyimage,
enemyEvade: _enemyEvadeScore,
enemyAbility: _enemyability,
enemyDesc: _description,
enemyXP: _enemyEXP,
enemyLoot: _loot
}>>
<</silently>>\
<</widget>>\<<if !$visibleMissions or $visibleMissions.length == 0>>
<<refreshMissions>>
<</if>>
<div class="bounty-board-container">
<div class="bounty-header">
<h2>⚔️ Bounty Board</h2>
<p class="bounty-subtitle">Available missions in <<print $currentRegion>></p>
</div>
<div class="missions-list">
<<for _mission range $visibleMissions>>
<div class="mission-entry">
<div class="mission-top">
<div class="mission-info">
<span class="mission-name"><<print _mission.name>></span>
<!-- KNOWN COMBAT: Show danger with skulls -->
<<if _mission.isCombat eq true>>
<div class="danger-indicator">
<<getDangerDisplay _mission.actualDangerLevel>>
<span class="danger-level">Lv. <<print _mission.actualDangerLevel>></span>
</div>
<!-- UNKNOWN COMBAT: Show ??? -->
<<elseif _mission.isCombat eq "unknown">>
<div class="danger-indicator">
<span class="danger-unknown">Danger: ???</span>
</div>
<</if>>
</div>
<div class="mission-reward">
<span class="reward-value"><<print _mission.reward>></span>
<span class="reward-label">spirit stones</span>
</div>
</div>
<p class="mission-description"><<print _mission.description>></p>
<!-- KNOWN COMBAT: Show enemy realm -->
<<if _mission.isCombat eq true>>
<div class="mission-enemy-info">
<span class="enemy-label">Enemy:</span>
<span class="enemy-realm"><<print _mission.estimatedRealm>></span>
<<if _mission.estimatedStage neq "" and _mission.estimatedStage neq null>>
<span class="enemy-stage">[<<print _mission.estimatedStage>>]</span>
<</if>>
</div>
<!-- UNKNOWN COMBAT: Show ??? -->
<<elseif _mission.isCombat eq "unknown">>
<div class="mission-enemy-info">
<span class="enemy-label">Possible Threat:</span>
<span class="enemy-unknown">??? Unknown ???</span>
</div>
<</if>>
<div class="mission-actions">
<<if $SideMissionStatus is null>>
<<capture _mission>>
<<link "✓ Accept Mission" "Bounty Board">>
<<set $MissionType to "side">>
<<set $activeSideMission to clone(_mission)>>
<<set $SideMissionStatus to "accepted">>
<<replace "#missionlog">>
<div class="mission-accepted">
✓ Accepted: <strong><<= _mission.name>></strong>
</div>
<</replace>>
<</link>>
<</capture>>
<</if>>
</div>
</div>
<</for>>
</div>
<div id="missionlog"></div>
<<if $activeSideMission neq null>>
<div class="active-mission-panel">
<h3>🎯 Current Mission</h3>
<p><strong><<print $activeSideMission.name>></strong></p>
<!-- KNOWN COMBAT: Show expected enemy -->
<<if $activeSideMission.isCombat eq true>>
<p class="enemy-info">Expected Enemy: <<print $activeSideMission.estimatedRealm>>
<<if $activeSideMission.estimatedStage neq "" and $activeSideMission.estimatedStage neq null>>
[<<print $activeSideMission.estimatedStage>>]
<</if>>
</p>
<!-- UNKNOWN COMBAT: Show unknown status -->
<<elseif $activeSideMission.isCombat eq "unknown">>
<p class="enemy-info">Possible Threat: ??? Unknown ???</p>
<</if>>
<p class="reward-info">Reward: <<print $activeSideMission.reward>> spirit stones</p>
<div class="mission-controls">
<br>
<<link "❌ Abandon Mission" "Bounty Board">>
<<set $activeSideMission to null>>
<<set $SideMissionStatus to null>>
<<replace "#missionlog">>
<div class="mission-abandoned">
✗ Mission abandoned
</div>
<</replace>>
<</link>>
</div>
</div>
<</if>>
<div class="bounty-controls">
<<link "🔄 Refresh Missions" "Bounty Board">>
<<refreshMissions>>
<</link>>
<br>
<<link "⬅️ Return" $passage>><</link>>
</div>
</div><<if $mainStageStarted eq "false">>
You cautiously approach the source of the light. As you draw near, you discover a small, swirling entrance—a shimmering portal, deliberately hidden beneath layers of sealing arrays.
<br>
Before you can react, an unknown force grabs you, pulling you through the portal with overwhelming power!
<<timed 2s>>
You lose consciousness for a moment. When you open your eyes, you find yourself standing in a hidden, subterranean realm. Ancient runes glow faintly, but they aren't meant to keep intruders out—they are meant to hide this place from the sky above.
<<linkappend "Continue">>
As you step deeper into the ancient tomb, the air grows heavy and suffocating. Dust floats in the dim, golden light leaking from cracks in the ceiling.
<br>
At the far end of the chamber lies a raised platform. An ornate coffin rests at its center, flanked by shattered statues of phoenixes. The atmosphere is thick with spiritual pressure, a desperate, lingering will.
Suddenly, a faint blue mist rises from the coffin—gathering into a fractured, humanoid form.
<br><span class="soul">"So... a mortal seed wanders into the ashes. Or did the Heavenly Bureaucracy finally find me?"</span>
You tense instinctively. The presence is immense, but it feels like a dying ember.
<br><span class="player">"I am no heavenly envoy. Who are you?"</span>
The mist wavers, flickering with ancient, unyielding fury.
<br><span class="soul">"I was Yu Wei, Shield-Bearer of the Blazing Phoenix Sect. But names are meaningless now. I am the last echo of a rebellion that failed."</span>
He drifts closer, his hollow eyes piercing right through your dantian.
<br><span class="soul">"Your cultivation is pitiful. A mere insect in the grass. Yet... you are untainted by the Heavens' brand. I have no choice. The truth of this world must be carried out of this grave."</span>
<br>You hesitate. <span class="player">"What truth?"</span>
<br><span class="soul">"That the 'Ascension' you mortals pray for is a slaughterhouse."</span>
The air hums with resonance. The tomb grows dim.
<br><span class="soul">"Let me show you the Great Harvest. Let me show you what the Immortals do when their spiritual energy runs low..."</span>
<br><<linkappend "The world shifts. Your mind is pulled into the immortal's final memory.">>
<br>You stand at the edge of a burning world. The skies are torn open, revealing colossal, golden figures looking down from the clouds. They do not wield weapons; they wield massive, spatial nets.
<br>
<br>You watch in horror as thousands of flying cultivators are sucked into the sky. You see a grand sect leader, a being of unimaginable power, caught in a golden beam. He doesn't die in combat—he is refined alive, compressed until his screaming soul and centuries of cultivation are turned into a single, glowing pill.
<br><img src="images/Story/ancientharvester.png" width=70%>
<br>
<br><span class="soul">"They do not rule us. They farm us. When our plane grew too strong, they came to reap the crops."</span>
<br><img src="images/Story/sectharvest.png" width=70%>
<br><span class="soul">"We refused to be medicine for the Upper Realms. We burned so that one spark might remain."</span>
<br><<linkappend "Return to the Tomb">>
<br>The vision shatters. You're back in the tomb, gasping for air. Yu Wei flickers violently, his spirit rapidly dissipating.
<br><span class="soul">"I hid this tomb beneath the mortal fringes to escape their Divine Sense. But my time is up."</span>
<br>He reaches into his own ethereal chest and pulls out a crystalline, blazing seed.
<br><span class="soul">"This is the Sovereign Core. The foundation of a sect that bows to no heaven. Take it to the Verdant Wilds beyond the northern pass. Find a Spirit Vein. Plant it. Build a fortress in the shadows, and become the variable they cannot calculate."</span>
<br>
He thrusts the core into your chest. It burns itself into your soul.
As the light fades, the tomb begins to collapse. You are forcefully expelled from the hidden realm.
<br><<link "Embrace the Core's power and return to the surface." "Map|Region1">><<unset $battleRound>>
<<set $mainStageStarted to "true">>
<<set $baseatk +=4>><<set $basedef +=4>><<set $baseagility +=4>><<set $baseluck +=4>><<set $baseinsight +=4>>
<<set $sectFoundationSeed to true>>
<<LogEvent "story" "The Last Echo of the Blazing Phoenix Sect" "Deep beneath the mortal lands, a forgotten tomb revealed the final words of Yu Wei, a fallen protector of the Blazing Phoenix Sect. He claimed that Ascension was not the blessing mortals believed it to be, and warned of a hidden truth beyond the heavens. Before his spirit vanished, he entrusted you with the Sovereign Core — a remnant of a rebellion that refused to kneel." 1>>
<</link>>
<</linkappend>>
<</linkappend>>
<</linkappend>>
<</timed>>
<</if>>
<<if $mainStageStarted eq "true" and $mainStage eq 0>>
<<if $pe eq 0>>
The trail of dead spiritual flora leads you to the base of a weeping willow, its leaves turned a bruised, sickly purple. There, sprawled among roots that seem to be drinking from his wounds, lies a man. His robes are shredded, soaked in a mixture of dark bile and oxygenated blood.
His condition is a nightmare of Qi Deviation. His skin ripples as if thousands of insects are crawling beneath the surface. In his death grip, he clutches a scroll that makes your skin crawl. It isn't made of bamboo—it is preserved human skin, inscribed with fresh blood.
<br><video src="images/Story/ancient_scroll.mp4" class="nsfw-glow" autoplay loop muted playsinline></video>
The man’s head snaps toward you. His eyes are swirling vortices of chaotic smoke.
<br><span class="male">"The heavens are a lie!"</span> he rasps, a spray of blood hitting the grass. <span class="male">"We read the ancient steles! We saw the Harvest! The only way to survive the Upper Realm is to become a monster before they do!"</span>
<br>He thrusts the skin-scroll toward you.
<br><span class="male">"Take it... The Essence Leech! It’s the only way to grow fast enough to hide from their sight! We ate our own master's foundation to survive... but the Qi is too violent! Don't look at it! DON'T—"</span>
<br>He collapses into a fit of violent coughing. The scroll pulses against your palm, offering a shortcut to immense power at the cost of your humanity.
<br><<link "Incinerate the scroll. Refuse the cannibalistic Dao." "MainMissionStart">><<set $pe to 1>><<set $mainStage0choice to "incinerate">><</link>>
<br><<link "Learn the forbidden technique and leave him." "MainMissionStart">><<set $pe to 2>><<set $mainStage0choice to "learn">><</link>>
<br><<link "Use the forbidden technique to consume his remaining life-force." "MainMissionStart">><<set $pe to 3>><<set $mainStage0choice to "consume">><</link>>
<<elseif $pe eq 1>>
To keep this would be to invite the same madness that broke his soul, and to become no better than the Immortals who treat mortals like livestock. You channel your Qi—not to take, but to cleanse.
<br><span class="player">"If I must defy the heavens, I will do it with my own strength, not the stolen lives of others."</span>
As you ignite your spiritual fire, the human-skin scroll shrieks. It curls into white ash, and the heavy scent of rot is replaced by the smell of rain. The cultivator’s body relaxes, his jagged veins fading into a peaceful grey. In the ashes, a single crystalline seed remains—pure Celestial Dew.
<br><span class="male">"Thank... you... sister..."</span> his final whisper carries on the wind.
<br><<link "Leave the area quickly." "Map|Region1">><<unset $battleRound>>
<<set $righteousreputation += 35>>
<<set $daoAlignment += 10>> /* Positive for Righteous */
<<set $activeDaoImprint = $harmonizedessence>>
<<set $mainStage += 1>>
<<LogEvent "story" "The Forbidden Dao - Essence Leech Scripture" "A dying cultivator offered a forbidden technique born from desperation. The Essence Leech Scripture promised rapid growth by consuming the cultivation of others, but at the cost of one's humanity. Whether destroyed, studied, or used, the encounter revealed that the struggle against Heaven has already driven many cultivators toward monstrous paths." 1>>
<</link>>
<<elseif $pe eq 2>>
You look at the dying man. He is already a ghost; his power is fleeting, but the knowledge on this skin is eternal. If you are to build a sect to defy the Great Harvest, you cannot afford to ignore any advantage, no matter how foul.
<br><span class="player">"Your sacrifice is noted. I will carry this burden so you don't have to."</span>
You memorize the agonizing characters of the Essence Leech. Each word feels like a cold needle stitching itself into your brain. You tuck the scroll into your robes. The man reaches out, begging for an end you do not give.
You turn your back on him, walking away with a secret that will rapidly accelerate your future disciples' growth—if it doesn't drive them mad first.
<br><<link "Leave the area quickly." "Map|Region1">><<unset $battleRound>>
<<set $demonicreputation += 10>>
<<LogEvent "story" "The Forbidden Dao - Essence Leech Scripture" "A dying cultivator offered a forbidden technique born from desperation. The Essence Leech Scripture promised rapid growth by consuming the cultivation of others, but at the cost of one's humanity. Whether destroyed, studied, or used, the encounter revealed that the struggle against Heaven has already driven many cultivators toward monstrous paths." 1>>
<<set $sectLibraryUnlock_EssenceLeech to true>>
<<set $activeDaoImprint = $devouringessence>>
<<set $mainStage += 1>>
<</link>>
<<elseif $pe eq 3>>
The air is thick with the scent of his failing life. To let it dissipate into the atmosphere is a waste of resources. The Immortals harvest the weak; why shouldn't you?
<br><span class="player">"Why let your cultivation return to the world when it can fuel my rebellion? Consider this your final contribution."</span>
You place your hand directly over the man’s shattering Dantian. You don't just learn the technique; you execute it.
<br><span class="male">"NO! PLEASE—AGHHH!"</span>
<br>His scream is cut short as his body begins to collapse inward. You feel a rush of hot, violent energy surge up your arm—raw, unrefined Qi, flavored with his terror. His skin turns to dry parchment. When you stand up, you feel a terrifying strength thrumming in your veins. Your shadow seems just a little darker, and the heavens feel a little closer.
<br><<link "Leave the area quickly." "Map|Region1">><<unset $battleRound>>
<<set $baseatk +=3>><<set $basedef +=3>><<set $baseagility +=3>><<set $baseluck +=3>><<set $baseinsight +=3>>
<<set $demonicreputation += 35>>
<<LogEvent "story" "The Forbidden Dao - Essence Leech Scripture" "A dying cultivator offered a forbidden technique born from desperation. The Essence Leech Scripture promised rapid growth by consuming the cultivation of others, but at the cost of one's humanity. Whether destroyed, studied, or used, the encounter revealed that the struggle against Heaven has already driven many cultivators toward monstrous paths." 1>>
<<set $daoAlignment -= 15>> /* Negative for Demonic */
<<set $sectExposure += 5>> /* The Heavens noticed that dark spike in Qi */
<<set $activeDaoImprint = $devouringessence>>
<<set $corruption += 15>>
<<set $mainStage += 1>>
<</link>>
<</if>>
<</if>>
/*===================
===========MISSION STAGE 3 PLOT MISSION3 PLOT STORYLINE
============================================ */
<<if $mainStageStarted eq "true" and $mainStage eq 1>>
<<if $pe eq 0>>
You travel through the northern wilderness, following a narrow mountain path where few cultivators venture.
<br>
The surrounding forests are unusually quiet.
Too quiet.
<br>
Even the insects have stopped chirping.
The spiritual energy here feels strange. Not weak... but incomplete. Like something has been removed from the land itself.
<br>
As you continue forward, you notice a broken wooden cart beside the road.
An old merchant is desperately trying to repair one of its wheels.
Beside him sits a frightened horse that refuses to move any further.
<br>
The merchant notices you approaching and immediately stands.
<br><span class="male">"A cultivator! Thank the heavens... I thought I would be stranded here until nightfall."</span>
<br>
The old man looks toward the distant mountains.
His xpression becomes nervous.
<br><span class="male">"I need to reach Willow Creek Village before sunset. My goods are valuable, and the road ahead has become dangerous."</span>
<br>
He hesitates.
<br><span class="male">"Recently, several travelers have disappeared near those forests. Even beast hunters refuse to enter that area anymore."</span>
<br>
The merchant looks at your robes and the spiritual pressure surrounding you.
<br><span class="male">"I cannot offer much, but I would pay whatever I can if you could escort me there."</span>
<br><<link "Accept the escort." "MainMissionStart">><<set $pe to 1>><</link>>
<br><<link "Refuse and continue your journey." "Map|Region1">><<unset $battleRound>><</link>>
<<elseif $pe eq 1>>
<<if $c is 1>>
There are no birds.
No insects.
No animals.
Only silence.
<<else>>
After several hours of travel, you finally arrive at Willow Creek Village.
<br>
The village looks peaceful.
<br>
Wooden houses line the road.
Farmers work in the fields.
Children run between the buildings, laughing.
<br>
Yet something feels wrong.
<br>
There are no birds.
No insects.
No animals.
Only silence.
<br>
As you enter the village, an elderly woman approaches you.
She smiles warmly.
<br><span class="female">"Welcome, honored cultivator. It has been a long time since someone from outside visited our village."</span>
<br>
She bows.
<br><span class="female">"I am the village elder. Please, rest at our guest house if you require shelter."</span>
<br>
You look around.
The villagers are friendly.
Almost too friendly.
<br>
Everyone smiles.
Everyone greets you.
But nobody seems curious.
Nobody asks your name.
Nobody asks where you came from.
<br>
Something is missing.
<br>
You decide to investigate the village.
<br>
<</if>>
<br>
<<link "Ask about the village history">>
<<goto "MainMissionStart">>
<<set $pe to 2>>
<</link>>
<br>
<<link "Speak with the villagers">>
<<goto "MainMissionStart">>
<<set $pe to 3>>
<</link>>
<br>
<<if $c is 1>>
<<link "Investigate the abandoned shrine">>
<<goto "MainMissionStart">>
<<set $pe to 4>>
<</link>>
<</if>>
<<elseif $pe eq 2>>
You enter the village elder's home.
<br>
Old books and wooden records cover the shelves.
<br>
The elder notices your interest.
<br><span class="female">"Our village has existed for hundreds of years. These records contain the names of every family that has lived here."</span>
<br>
You examine the records.
<br>
Hundreds of pages. Hundreds of names.
<br>
But every record suddenly ends ten years ago.
<br>
You look at the elder.
<br><span class="player">"Why do the records stop here?"</span>
<br>
The elder becomes silent.
<br><span class="female">"They do not."</span>
<br>
She looks confused.
<br><span class="female">"They have always been like this."</span>
<br>
You point toward the empty pages.
<br><span class="player">"You do not remember what happened before this?"</span>
<br>
The elder touches her head.
<br><span class="female">"I remember..."</span>
<br>
She pauses.
<br><span class="female">"I remember waking up one morning and everything felt normal."</span>
<br>
Her hands begin trembling.
<br><span class="female">"But now that you ask..."</span>
<br><span class="female">"I cannot remember my husband."</span>
<br>
Silence fills the room.
<br>
The Phoenix Sigil on your body suddenly burns.
<br>
A faint golden light shines from beneath the floor.
<br>
The elder looks terrified.
<br><span class="female">"That place..."</span>
<br><span class="female">"Nobody goes there."</span>
<br><span class="female">"Nobody remembers why."</span>
<br>
A hidden path beneath the village has revealed itself.
<br>
<<link "Return to the village" "MainMissionStart">><<set $c to 1>><<set $pe to 1>><</link>>
<<elseif $pe eq 3>>
You walk through the village, speaking with the residents.
<br>
At first, everything appears normal.
<br>
A farmer smiles as he repairs a fence.
<br><span class="male">"Beautiful weather today. The harvest should be good."</span>
<br>
You ask him how long his family has lived here.
<br>
The farmer freezes.
<br><span class="male">"My family...?"</span>
<br>
He looks confused.
<br><span class="male">"I suppose... for a long time."</span>
<br>
You ask about his parents.
<br>
The farmer's smile slowly disappears.
<br><span class="male">"My parents..."</span>
<br>
Silence.
<br>
His expression becomes frightened.
<br><span class="male">"I... I cannot remember their faces."</span>
<br>
---
Later, you speak with a young girl near the village well.
<br><span class="female">"Are you a cultivator? Do you know many places outside this village?"</span>
<br>
You ask her how old she is.
<br>
She thinks for a moment.
<br><span class="female">"I don't know."</span>
<br>
She laughs awkwardly.
<br><span class="female">"Mother says I am young, but I don't remember when I was born."</span>
<br>
The girl's expression changes.
<br><span class="female">"Is that strange?"</span>
<br>
You say nothing.
<br>
Something is deeply wrong with this village.
<br><<link "Return to the village" "MainMissionStart">><<set $c to 1>><<set $pe to 1>><</link>>
<<elseif $pe eq 4>>
Beyond the village stands an abandoned shrine.
<br>
The wooden structure has collapsed long ago.
Roots grow through broken statues.
<br>
At the center sits a damaged phoenix carving.
<br>
Your Phoenix Sigil reacts.
<br>
A hidden staircase appears beneath the shrine.
<br>
You descend.
<br>
The deepe you go...
the heavier the spiritual pressure becomes.
<br>
At the bottom lies an enormous underground chamber.
<br>
The walls are covered with ancient formations.
<br>
A single sentence is carved into stone:
<br>
"Those taken by Heaven shall not be remembered."
<br>
Your expression changes.
<br>
You step forward.
The formation activates.
<br>
Your vision becomes covered in golden light.
<br>
<<link "..........." "MainMissionStart" >><<set $pe to 5>>
<</link>>
<<elseif $pe eq 5>>
The underground chamber disappears.
<br>
Your body feels weightless.
<br>
When you open your eyes again, you are no longer beneath Willow Creek Village.
<br>
You stand in the same place...
but decades in the past.
<br>
The village is alive.
<br>
Children run through the streets.
<br>
Families gather together.
<br>
Cultivators from nearby regions visit the village, bringing gifts and congratulations.
<br>
The atmosphere is full of joy.
<br>
A young couple proudly holds a small child in their arms.
<br><span class="male">"Our daughter awakened a Heavenly Grade Spiritual Root!"</span>
<br><span class="female">"The ancestors must be smiling upon us."</span>
<br>
Nearby, another family celebrates.
<br><span class="male">"Our son will surely become a great cultivator."</span>
<br>
The entire village is celebrating.
<br>
You realize the reason.
<br>
This generation produced several children with extraordinary talent.
<br>
Children who could become powerful cultivators.
<br>
Children who could change the future.
<br>
<<link "Then..." "MainMissionStart" >><<set $pe to 6>><</link>>
<<elseif $pe eq 6>>
<br>
The sky changes.
<br>
The laughter slowly fades.
<br>
A golden crack appears above the village. The clouds separate. An enormous gate appears in the heavens. Spiritual pressure descends upon the entire land.
<br>
Every villager falls to their knees. Several figures slowly descend from the golden gate.
<br>
Their robes are flawless. Their presence is beyond anything you have ever felt. They do not look like monsters.
<br>
They look like saints.
<br>
One of them steps forward.
<br><span class="male">"People of Willow Creek Village."</span>
<br><span class="male">"Rejoice."</span>
<br><span class="male">"Your descendants have been recognized by the Heavenly Realm."</span>
<br>
The villagers cry tears of happiness. Parents embrace their children. The Heavenly cultivator smiles.
<br><span class="male">"Those chosen shall leave the mortal world behind."</span>
<br><span class="male">"They shall walk a path beyond ordinary life."</span>
<br><span class="male">"They shall become immortal."</span>
<br>
The children look excited. They believe they have been blessed. One by one, they approach.
<br>
Golden light surrounds them. Chains of pure spiritual energy wrap around their bodies. But there is no struggle.
<br>
No screams.
<br>
The children smile. They wave goodbye.
<br>
<<link "A young girl turns toward her mother." "MainMissionStart">><<set $pe to 7>><</link>>
<<elseif $pe eq 7>>
<br><span class="female">"Mother, I will return after becoming an immortal."</span>
<br>
Her mother cries.
<br><span class="female">"We will wait for you."</span>
<br>
The girl disappears into the golden light.
<br>
One child.
<br>
Then another.
<br>
Then another.
<br>
Until every gifted child is gone. The villagers continue celebrating. Until the Heavenly cultivators raise their hands.
<br>
The golden light changes.
<br>
It spreads across the entire village. You feel something is wrong. This is not a blessing. This is a formation.
<br>
The villagers freeze. Their expressions become empty. Memories begin disappearing.
<br>
A father looks at an empty room.
<br><span class="male">"Why do I feel like I lost something important?"</span>
<br>
A mother touches her face.
<br><span class="female">"Why... why am I crying?"</span>
<br>
Family portraits fade. Names vanish from ancestral records. The villagers forget.
<br>
Not just the children. They forget they ever existed. The Heavenly cultivator watches silently.
<br>
A younger disciple beside him hesitates.
<br><span class="male">"Senior, was this necessary?"</span>
<br>
The elder Heavenly cultivator looks toward the village.
<br><span class="male">"Necessary?"</span>
<br>
He calmly answers.
<br><span class="male">"Every world must contribute to the continuation of Heaven."</span>
<br><span class="male">"A few talented seeds are a small price for countless lives protected above."</span>
<br>
The younger disciple remains silent. The elder turns away.
<br><span class="male">"The mortals will forget."</span>
<br><span class="male">"They always do."</span>
<br>
The golden gate closes.
<br>
<<link "The vision shatters." "MainMissionStart">><<set $pe to 8>>
<</link>>
<<elseif $pe eq 8>>
You awaken violently.
<br>
You fall onto the cold stone floor beneath the shrine. Your breathing is heavy.
<br>
The ancient formation around you has almost completely collapsed. For several moments, you cannot move.
<br>
You look toward the village above. People continue living their lives.
<br>
Laughing.
<br>
Working.
<br>
Completely unaware of what was stolen from them. A small crystal lies beside you. A remnant of the ancient recording formation. When you touch it, a faint voice echoes.
<br><span class="male">"If someone finds this..."</span>
<br>
The voice trembles.
<br><span class="male">"Please remember them."</span>
<br><span class="male">"Someone must remember."</span>
<br>
The crystal cracks.
<br>
The voice disappears.
<br>
You slowly stand. The truth is becoming clearer. The Heavenly Realm does not need armies.
<br>
It does not need wars.
<br>
It only needs people to believe.
<br>
<<link "And forget." "MainMissionStart">><<set $pe to 9>><</link>>
<<elseif $pe eq 9>>
You return to Willow Creek Village. The villagers continue their peaceful lives.
<br>
They do not know what happened. They do not know what was taken from them.
<br>
You now possess a truth that could destroy their happiness.
<br>
What will you do?
<br>
<span id="choice1">
<<linkreplace "Tell the villagers the truth">>
<<replace "#choice2">><</replace>>
<<replace "#choice3">><</replace>>
<<set $willowTruthRevealed = true>>
You gather the villagers.
<br>
You tell them everything.
<br>
Some refuse to believe you.
<br>
Others begin crying without understanding why.
<br>
The village elder quietly looks toward the empty fields.
<br><span class="female">"I do not remember my child..."</span>
<br><span class="female">"But my heart tells me I lost someone."</span>
<br>
The village will never be the same.
<br>
<br><<startStatChanges>>
<br><<gainStat "righteousreputation" "righteousreputation" 5 0 999 "Righteous Reputation">>
<br><<showStatChanges>>
<<link "..." "MainMissionStart">><<set $pe to 10>><</link>>
<</linkreplace>>
</span>
<br>
<span id="choice2">
<<linkreplace "Keep the truth hidden">>
<<replace "#choice1">><</replace>>
<<replace "#choice3">><</replace>>
<<set $harvestKnowledge += 1>>
You decide not to tell them.
<br>
What purpose would pain serve?
<br>
The villagers are happy.
<br>
But now you know the cost of their happiness.
<br>
<<link "..." "MainMissionStart">><<set $pe to 10>><</link>>
<</linkreplace>>
</span>
<br>
<span id="choice3">
<<linkreplace "Study the formation before leaving">>
<<replace "#choice2">><</replace>>
<<replace "#choice1">><</replace>>
You remain beneath the shrine.
<br>
You carefully examine the ancient formation.
<br>
The technique is beyond your current understanding.
<br>
But you discover one terrifying fact.
<br>
This formation was not unique.
<br>
Similar ones exist across the world.
<br>
<br><<startStatChanges>>
<br><<gainStat "baseinsight" "baseinsight" 1 0 999 "Insight">>
<br><<showStatChanges>>
<<link "..." "MainMissionStart">><<set $pe to 10>><</link>>
<</linkreplace>>
</span>
<<elseif $pe eq 10>>
The events of Willow Creek Village will remain with you.
<br>
You have learned something more frightening than any beast.
<br>
The greatest threat to mortals does not always arrive with destruction.
<br>
Sometimes...
<br>
It arrives with a smile.
<br>
<<LogEvent "story" "The Village That Forgot Tomorrow - Heaven's Harvest" "For generations, mortals have dreamed of ascending beyond the mortal realm.But some who ascended never returned.The truth is far more terrible. The heavens do not only judge cultivators. They collect them. " 1>>
<<link "Continue with your journey" "Map|Region1">>
<<set $pe to 0>>
<<set $mainStage = 2>>
<<set $mission2Complete = true>>
<<unset $battleRound>>
<</link>>
<</if>>
<</if>>
/*===================
===========MISSION STAGE 4 PLOT MISSION3 PLOT STORYLINE
============================================ */
<<if $mainStage eq 2>>
<<if $pe eq 0>>
<br>
Some wear the robes of righteous sects.
Others travel alone.
Several demonic cultivators openly laugh among themselves, unconcerned by the hostile stares they receive.
<br>
Everyone seems unusually excited.
<br>
Eventually, a cheerful young cultivator notices your curiosity.
<br><span class="male1">"You're heading toward Northern Phoenix City too?"</span>
<br>
You shake your head.
<br><span class="player">"I wasn't planning to."</span>
<br>
The young cultivator looks surprised.
<br><span class="male1">"You haven't heard?"</span>
<br><span class="male1">"The Regional Martial Tournament begins tomorrow!"</span>
<br><span class="male1">"Cultivators from every nearby sect are participating."</span>
<br><span class="male1">"Even wandering cultivators are allowed this year."</span>
<br>
He grins.
<br><span class="male1">"If your strength is real, this is your chance to become famous."</span>
<br>
<span id="choice1">
<<if $CurrentPcAffiliation neq "None">>
<<link "Travel to Northern Phoenix City" "Map|Region1">>
<<unset $battleRound>>
<<set $lastStoryAction to $totalTurns>> <!-- Starts the 50-turn countdown -->
<<set $storyEvent.cooldown to 0>> <!-- Reset cooldown -->
<<set $mainStage = 2.5>>
<</link>>
<<else>>
<<link "Travel to Northern Phoenix City as an independent cultivator" "Map|Region1">>
<<unset $battleRound>>
<<set $mainStage = 2.5>>
<<set $lastStoryAction to $totalTurns>> <!-- Starts the 50-turn countdown -->
<<set $storyEvent.cooldown to 0>> <!-- Reset cooldown -->
<</link>>
<</if>>
</span>
<br>
<span id="choice1">
<<linkreplace "Ignore the tournament">>
<<replace "#choice1">><</replace>>
You decide your current cultivation is more important than temporary fame.
<br>
<<link "Perhaps another opportunity will arise later." "Map|Region1">><</link>>
<<unset $battleRound>>
<</linkreplace>>
</span>
<</if>>
<</if>>
/*===================
===========MISSION STAGE 4 PLOT MISSION3 PLOT STORYLINE
============================================ */
<<if $mainStage eq 2.5>>
<<if $pe eq 0>>
Northern Phoenix City has never been so crowded.<br> Cultivators from every corner of the region fill the streets.
<br>Merchants loudly advertise pills, talismans and spiritual weapons.
<br>The city practically vibrates with spiritual energy.<br>
At the center of the city stands an enormous arena.<br>A line of participants stretches across the plaza.
<br>You approach the registration table.<br>The elderly official studies you carefully.
<<if $CurrentPcAffiliation is "Righteous Sect">>
<br><span class="male">"A disciple of the righteous path."</span>
<br><span class="male">"Very well. Your sect has already submitted your name."</span>
<<elseif $CurrentPcAffiliation is "Demonic Sect">>
<br><span class="male">"A disciple of the demonic path..."</span><br>
The official sighs.
<br><span class="male">"Cause trouble and you'll be removed immediately."</span>
<<else>>
<br><span class="male">"An independent cultivator?"</span><br>
The old man raises an eyebrow.
<br><span class="male">"Not many survive long enough to compete."</span>
<br><span class="male">"Name?"</span>
<br><span class="player">"$playerfullname."</span><br>
The official nods.
<br><span class="male">"You're registered."</span>
<</if>>
<br>
As you leave the registration table... you notice another participant.
<br>
A young man quietly watches the arena.
<br>
Unlike everyone else... he isn't excited.
<<linkreplace "Try speaking to him">>
<br><span class="player">"First tournament?"</span><br>He smiles faintly.
<br><span class="male">"No."</span>
<br><span class="male">"My third."</span><br>You look surprised.<br><span class="player">"Then why don't you look happy?"</span><br>
He watches the arena.<br><span class="male">"Every year..."</span><br><span class="male">"Someone extraordinary disappears."</span><br>He chuckles quietly.
<br><span class="male">"Maybe I'm simply imagining things."</span>
<br><<link "Go to tournament area" "MainMissionStart">><<set $pe to 1>><</link>>
<</linkreplace>>
<<elseif $pe eq 1>>
The streets are overflowing with travelers, merchants, disciples and independent wanderers.<br>
Every inn is full. Every tavern is loud. Every alleyway hums with spiritual pressure.<br>
Even the air feels charged, as if the entire city is holding its breath.<br>
At the center of the city stands the enormous tournament arena. <br>
The stone walls are covered in banners from every major faction in the region. <br>Righteous sects. Demonic sects. Independent cultivation clans. <br>
All of them have come to watch. All of them have come to measure their strength. All of them have come to see who will rise above the rest. <br>
A white-robed official stands at the registration platform and loudly announces the rules.
<br><span class="male">"The Regional Martial Tournament begins at sunrise tomorrow."</span>
<br><span class="male">"Participants may fight in the preliminary rounds until only the strongest remain."</span>
<br><span class="male">"No killing inside the arena unless your opponent forfeits by death."</span>
<br><span class="male">"If you lose, you leave the stage."</span>
<br><span class="male">"If you win, you advance."</span>
<br><span class="male">"If you break the rules, you will be expelled."</span> <br>
The crowd cheers.
<br>
A nearby young cultivator grins at you.
<br><span class="male">"This year is going to be exciting."</span>
<br><span class="male">"Even wandering cultivators were allowed in."</span>
<br><span class="male">"If you are strong enough, you might actually make a name for yourself."</span>
<br> You look toward the arena.
<br> A familiar pressure touches your senses. Several of the faces in the crowd seem hungry for victory. Several are hiding fear.A few appear far too calm.
That unsettles you more than open hostility.
<br> You can feel it. <br> This tournament is not just a competition. <br> It is a selection. <br>
<<if $CurrentPcAffiliation eq "Righteous Sect">>
The disciples from your sect gather nearby. Some glance at you with expectation. Others with cold suspicion. An inner disciple steps closer and gives a short nod.
<br><span class="male">"Do not disgrace the sect."</span>
<br>
<<elseif $CurrentPcAffiliation eq "Demonic Sect">>
The demonic disciples around you laugh casually. One of them flashes a sharp grin. <span class="male">"Win if you can. Kill if you must. Just do not bore us."</span> <br>
<<else>>
You stand apart from the others. No sect banner. No elders. No protection. Only your own strength. A few cultivators look at you with open contempt.<br>
Others look curious. A wandering cultivator who survives this tournament will be remembered. <br><</if>><br>
As you wait for the opening ceremony, a young man approaches. He wears plain robes, but his posture is straight and controlled. <br>
He is not flashy. Not arrogant. Not noisy. Yet the spiritual pressure around him is deep and steady. He looks toward the arena, not at the crowd.
<br><span class="male">"You are here for the tournament too?"</span>
<br>
You nod.
<br><span class="player">"That is the plan."</span>
<br>
He gives a faint smile.
<br><span class="male">"Then perhaps we will meet in the ring."</span>
<br><span class="male">"I hope you are stronger than you look."</span>
<br>
There is no hostility in his voice. Only quiet certainty. <br> You study him for a moment. <br><span class="player">"And you?"</span>
<br>
He glances upward.
<br><span class="male">"I am only here to see whether the sky still takes what it wants."</span>
<br>
That sentence lingers in your mind.
<br>
Before you can ask more, the gong of the tournament sounds across the city.
<br>
<<link "The event has begun." "MainMissionStart">> <<set $timeToTournament to 3>>
<<set $pe to 2>><</link>>
<<elseif $pe eq 2>>
Suddenly, the crowd goes silent. The bearded white-robed official raises his hands before speaking. The sheer pressure of his cultivation makes the air feel heavy. The crowd bows their heads in respect. The official's voice booms across the arena.
<br><span class="powerful">"I see many of famed rising stars in the crowd today. I see many of the most talented disciples from the righteous sects. I see many of the most cunning disciples from the demonic sects. I see many wandering cultivators who have survived long enough to be here."</span>
<br>He makes a sweeping gesture toward the crowd. He makes longer pause before speaking again. The crowd is silent, waiting for his next words.
<br><span class="powerful">"I proclaim that time for registration has ended. First arena matches will begin in 3 days from today! For now, all of you gathered here for greater sake are free to take part in Festival! I hope I don't have to remind you that during festival, participants are not allowed to leave tournament area!"</span>
<br><<link "Approach young man from before" "MainMissionStart">><<set $pe to 3>><</link>>
<br><<link "Go to main area" "MainMissionStart">><<set $pe to 4>><</link>>
<<elseif $pe eq 3>>
You stop beside the lone cultivator. <br> He does not turn immediately. <br> After a moment, he speaks.
<br><span class="male1">"You are not from a major city."</span>
<br> You glance at him. <br>
<span class="player">"And you know that from one look?"</span>
<br> He gives a faint smile.
<br><span class="male1">"Only people from powerful places stand like they already belong at the top. You don't. That means either you are foolish... Or dangerous."</span>
<br> You study him in return.
<br><span class="player">"You don't look excited about the tournament."</span>
<br> His gaze turns toward the arena.
<br><span class="male1">"Every year, someone talented disappears.Everyone calls it ascension, opportunity, fortune... But I have never liked the way people smile when they say it."</span>
<br> He turns to you.
<br><span class="male1">"My name is Shen Tian. If you survive the tournament, come speak with me again."</span>
<br> A strange feeling settles in your chest.
<br> This man may become a rival. <br> Or an ally. <br> Or something more dangerous. <br>
<<set $shenTianMet = true>>
<<link "Go prepare for the tournament">> <<goto "MainMissionStart">><<set $pe to 4>> <</link>>
<<elseif $pe eq 4>>
<div style="text-align:center;">
<h2 class="town-title">Days to tournament: <<print $timeToTournament>></h2>
<div style="font-size: 0.9em; color: #c5a059; margin-top:-5px;"></div>
</div>
<<if $shenTianMet is true>>
<br>You find Shen Tian in the crowd. He is watching the arena with a calm expression. When he sees you, he gives a small nod.<br>
<</if>>
<br>You're standing in the main area of the tournament sector. Leaving the city is forbidden for participants—you included. Carefully you observe the crowd. The festival is in full swing. Performers entertain the gathered masses. You see cultivators freely indulging in carnal pleasures; some are openly flirting, hands wandering with abandon. The atmosphere is lively, yet beneath the laughter something curdles—the excitement feels almost forced, as if everyone is playing a part in a larger scheme.
You know those few days will fly faster than a swallow before a storm.
<<if $timeToTournament gt 0>>
<br><<link "Participate in drinking games">><<set $pe to 5>><<set $timeToTournament to $timeToTournament - 1>><<goto "MainMissionStart">><</link>>
<br><<link "Hone your skills in the training area">><<set $pe to 6>><<set $timeToTournament to $timeToTournament - 1>><<goto "MainMissionStart">><</link>>
<br><<link "Watch street performers">><<set $pe to 7>><<set $timeToTournament to $timeToTournament - 1>><<goto "MainMissionStart">><</link>>
<<endif>>
<<if $timeToTournament lte 0>>
<<goto "MainMissionStart">><<set $pe to 8>>
<</if>>
<<elseif $pe eq 5>>
<div style="text-align:center;">
<h2 class="town-title">The Drinking Games</h2>
</div>
You join a group of cultivators in a drinking pavilion near the arena. Wine flows without end. Laughter echoes across tables laden with delicacies meant to fuel celebration—or intoxication.
<br><br>
A few rounds in, the crowd loosens. Inhibitions fall away like shed skin. Around you, cultivators become tactile. Hands linger on shoulders. Whispers that should remain private become shared jokes. The air tastes of fermented grapes and something sweeter—desire, maybe, or just the freedom that anonymity provides.
<br><br>
You notice two people watching the crowd with interest.
<br><br>
<<link "A woman in crimson silk catches your eye">><<set $pe to 5.1>><<goto "MainMissionStart">><</link>>
<br>
<<link "A beautiful man in jade robes commands the room">><<set $pe to 5.2>><<goto "MainMissionStart">><</link>>
<br>
<<elseif $pe eq 5.1>>
She sits alone at a nearby table, nursing wine with an expression of practiced boredom. But when you meet her gaze, her lips curve upward—a knowing smile that suggests she's been waiting for someone like you.
<br><br>
Her robes are cut to emphasise the line of her collarbone, the subtle curve where shoulder meets neck. A jade pendant shaped like a coiling serpent hangs at her throat—a demonic sect marker, perhaps, or just an aesthetic choice.
<br><br>
She gestures for you to join her.
<br><br>
<span class="female">"You look like someone who understands the difference between celebration and distraction,"</span> she says, her voice warm enough to intoxicate without the wine.
<br><br>
<<link "Sit with her and take control of the conversation">><<set $pe to 5.11>><<goto "MainMissionStart">><</link>>
<br>
<<link "Sit with her and let her set the pace">><<set $pe to 5.12>><<goto "MainMissionStart">><</link>>
<br>
<<link "Sit with her but keep a careful distance">><<set $pe to 5.13>><<goto "MainMissionStart">><</link>>
<br>
<<elseif $pe eq 5.11>>
You sit across from her, but the moment her hand finds your knee you catch her wrist and guide it higher, pressing her palm against the heat between your legs.
<br>
<span class="player">"I decide how close you get."</span>
<br><br>
Her eyes darken with interest. <span class="female">"Dangerous little thing, aren’t you."</span>
<br><br>
She leads you to her private pavilion without another word. The moment the door seals you shove her onto the bed, pin her wrists, and force a qi-forged strap into place. You fuck her hard and deep, making her take every inch while your fingers work her clit with deliberate cruelty. Every time she tries to reclaim control you hold her down harder, biting her throat, forcing her legs wider until she’s a shaking, sobbing mess.
<br><br>
When you finally let her cum she clings to you like she’s drowning. <span class="female">"What are you…?"</span>
<br>
<span class="player">"Someone who turns predators into pets."</span>
<br><br>
You leave her twitching on the sheets, your marks already darkening on her skin.
<br><br>
<<elseif $pe eq 5.12>>
You sit and let her lean in. Her hand slides higher under the table without resistance. She smiles like she’s already won.
<br>
<span class="female">"Good girl. Just relax."</span>
<br><br>
Her pavilion smells of jasmine and dark sugar. She strips you with practiced hands, binds your wrists with soft crimson silk, and uses you for hours. She rides your face until your jaw aches, then forces a thick carved jade phallus into you while pinching and twisting your nipples. Every time you try to close your legs she spreads them wider and spanks the insides until they burn.
<br><br>
By the time she lets you cum you’re a drooling, tear-streaked mess, begging without dignity. She leaves the toy inside you as a reminder.
<br>
<span class="female">"Survive the tournament and come back, little slut. I’ll break you properly next time."</span>
<br><br>
<<link "Stumble back to your quarters">><<set $pe to 4>><<set $meiChenAlly to true>><<goto "MainMissionStart">><</link>>
<<elseif $pe eq 5.13>>
You accept the wine but keep careful space between you. Conversation stays sharp and guarded. She tests your boundaries once or twice with a lingering touch, but when you don’t melt she simply laughs and respects the distance.
<br>
<span class="female">"Cautious. I like that more than I expected. If you survive, find me. We might still be useful to each other."</span>
<br><br>
No more than that happens. You leave with an ally and your dignity intact.
<br><br>
<<link "Return to your quarters">><<set $pe to 4>><<set $meiChenAlly to true>><<goto "MainMissionStart">><</link>>
<<elseif $pe eq 5.2>>
He’s at the centre of a group of admirers, telling a story with theatrical flair. His robes are expensive, dyed in shades of deep jade and gold that mark him as high-status. When he moves, other cultivators unconsciously gravitate toward him.
<br><br>
When he notices you watching, he breaks from his group and approaches with a predator’s grace.
<br>
<span class="male1">"You’re not drinking. How unusual,"</span> he says, his voice dripping with amusement. <span class="male1">"Either you’re prudent or you’re bored. I suspect it’s the latter."</span>
<br><br>
He sits beside you without asking permission.
<br>
<span class="male1">"I’m Zhao Lin. Senior disciple of the Azure Sword Sect. And you’re…?"</span>
<br><br>
There’s something magnetic about him—the kind of charisma that comes from absolute confidence. He’s used to getting what he wants, and he’s decided he wants <em>you</em>.
<br><br>
<<link "Match his arrogance and take control">><<set $pe to 5.21>><<goto "MainMissionStart">><</link>>
<br>
<<link "Let him lead and see how far he pushes">><<set $pe to 5.22>><<goto "MainMissionStart">><</link>>
<br>
<<link "Keep the conversation sharp but closed">><<set $pe to 5.23>><<goto "MainMissionStart">><</link>>
<br>
<<link "Deflect and leave before he can escalate">><<set $pe to 4>><<goto "MainMissionStart">><</link>>
<<elseif $pe eq 5.21>>
You catch his wrist when he reaches for your cup and dig your nails in just enough to warn.
<br>
<span class="player">"I don’t take what’s offered without deciding the price myself."</span>
<br><br>
His delighted laugh is genuine. Later, under moonlight in a deserted training courtyard, you have him on his knees in front of you. You force his face between your thighs and hold him there, grinding down until he’s gasping and drooling against you. Every time he tries to pull back for air you tighten your grip in his hair and ride his tongue harder.
<br><br>
When his cock is straining and leaking you refuse to touch it. You make him stay on his knees, hands behind his back, while you use his mouth and face for your own pleasure. You edge him with words alone—describing exactly how pathetic he looks, how easily the great Zhao Lin was reduced to a whimpering seat for a woman’s cunt.
<br><br>
You finish on his tongue, then leave him there on the stone, cock still hard and untouched, eyes glassy with frustrated need.
<br>
<span class="player">"Survive the tournament. Maybe I’ll let you finish next time."</span>
<br><br>
<<link "Return to your quarters">><<set $pe to 4>><<goto "MainMissionStart">><</link>>
<<elseif $pe eq 5.22>>
You let him guide the conversation, let his hand rest on your thigh a little longer each time. He takes the invitation.
<br><br>
In a shadowed side corridor he presses you against the wall, mouth on your neck, hand already under your robes. When you make a soft sound of protest he only laughs and holds you tighter.
<br>
<span class="male1">"Shh. You already said yes with every little lean."</span>
<br><br>
He fucks you right there, one hand over your mouth, the other gripping your hip hard enough to bruise. It’s rough, possessive, and he doesn’t stop until he’s finished inside you. Afterward he straightens your robes with almost gentle hands and kisses the mark he left on your throat.
<br>
<span class="male1">"Survive the tournament. I’ll be watching."</span>
<br><br>
You’re left aching and marked, the taste of him still on your tongue.
<br><br>
<<link "Return to your quarters">><<set $pe to 4>><<goto "MainMissionStart">><</link>>
<<elseif $pe eq 5.23>>
You match his wit without ever giving him an opening. The verbal sparring is sharp and enjoyable, but every time his hand drifts too close you redirect it with a smile that says the game ends there.
<br>
<span class="male1">"Frustrating little thing. If you survive, find me. I still want to see what happens when someone finally breaks that control."</span>
<br><br>
You leave him intrigued and empty-handed.
<br><br>
<<link "Return to your quarters">><<set $pe to 4>><<goto "MainMissionStart">><</link>>
<<elseif $pe eq 6>>
<div style="text-align:center;">
<h2 class="town-title">The Training Grounds</h2>
</div>
The training area is vast, filled with stone dummies, targets, and cultivators honing their techniques before the tournament begins.
<br><br>
You spend hours perfecting your strikes, your footwork, your Qi control. Sweat soaks through your robes. Your muscles burn pleasantly—the good kind of pain that comes from pushing yourself to your limits.
<br><br>
As the sun begins to set, most cultivators leave. But one remains.
<br><br>
A woman is practicing with a spear, moving through forms with mechanical precision. Her technique is flawless but cold—there’s no passion in it, just grinding repetition.
<br><br>
She’s beautiful in a severe way: sharp cheekbones, dark eyes that suggest she sees through most people’s pretences. Her robes mark her as unaffiliated—a wanderer, like you.
<br><br>
When she notices you watching, she doesn’t stop. She simply shifts her movement, as if showing off.
<br><br>
<<link "Approach and offer a serious spar">><<set $pe to 6.1>><<goto "MainMissionStart">><</link>>
<br>
<<link "Approach and keep the atmosphere light">><<set $pe to 6.2>><<goto "MainMissionStart">><</link>>
<br>
<<link "Meditate instead—watch from a distance">><<set $pe to 4>><<goto "MainMissionStart">><</link>>
<<elseif $pe eq 6.1>>
You step forward. <span class="player">"Your technique is precise. But you’re missing something."</span>
<br><br>
She stops mid-form, spear lowering. Her dark eyes narrow. <span class="female">"Is that so."</span>
<br>
<span class="female">"What am I missing?"</span>
<br>
<span class="player">"Intuition. You’re thinking too much about every movement."</span>
<br><br>
She laughs—sharp and bitter—but she’s intrigued. She gestures for you to take a practice weapon.
<br><br>
You trade blows for long minutes, evenly matched, until sweat drips and breathing turns heavy. On the final sequence you disarm her and pin her against the wall, blade framing her throat.
<br>
<span class="female">"Impressive."</span>
<br><br>
The space between you crackles.
<br><br>
<<link "Kiss her hard and take control">><<set $pe to 6.11>><<goto "MainMissionStart">><</link>>
<br>
<<link "Let the tension break the other way">><<set $pe to 6.12>><<goto "MainMissionStart">><</link>>
<br>
<<link "Step back and end it cleanly">><<set $pe to 6.13>><<goto "MainMissionStart">><</link>>
<<elseif $pe eq 6.11>>
You kiss her like the fight never ended—teeth and tongue and pressure. She answers with equal violence. In her sparse room you pin her face-down and fuck her with the same intensity you brought to the spar, qi-forged strap driving deep while your fingers and tongue take turns destroying her. You edge her ruthlessly until she’s sobbing and begging before you finally allow her release.
<br>
<span class="female">"I’m Rui. Survive the tournament… I want to lose to you again."</span>
<br><br>
<<link "Return to your quarters before dawn">><<set $pe to 4>><<set $ruiAllied to true>><<goto "MainMissionStart">><</link>>
<<elseif $pe eq 6.12>>
The moment your blade leaves her throat she surges up and reverses the pin. Suddenly you’re the one against the wall, her knee between your legs, her hand around your throat—not hard enough to choke, just hard enough to remind you who is stronger right now.
<br>
<span class="female">"You talk a lot for someone who just got lucky."</span>
<br><br>
She doesn’t take you to a room. She takes you right there against the training wall after the last stragglers leave. Her fingers are rough, efficient, almost cruel. When you try to touch her back she slaps your hands away and forces you to keep them above your head. She makes you cum twice against the cold stone before she even opens her own robes. By the time she finally rides your face and then uses a thick practice spear handle wrapped in silk, you’re shaking and half-delirious.
<br>
<span class="female">"Name’s Rui. Survive the tournament and maybe I’ll let you try to win next time."</span>
<br><br>
<<link "Crawl back to your quarters">><<set $pe to 4>><<set $ruiAllied to true>><<goto "MainMissionStart">><</link>>
<<elseif $pe eq 6.13>>
You step back, lowering your sword. She does the same.
<br>
<span class="female">"Thank you. For treating me like an equal."</span>
<br>
<span class="female">"I’m Rui. If you’re in the tournament, I’ll be watching."</span>
<br><br>
Nothing more happens. The respect is real.
<br><br>
<<link "Return to your quarters">><<set $pe to 4>><<goto "MainMissionStart">><</link>>
<<elseif $pe eq 6.2>>
You select a practice weapon and move into stance. The spar lasts twenty minutes and ends in a mutual draw, both of you equally exhausted.
<br>
<span class="female">"You’re good. I’m Rui. I hope we don’t face each other in the tournament… I’m not sure who’d win."</span>
<br>
<span class="player">"I’d like to find out."</span>
<br><br>
She nods, respecting the ambition. No further invitation is offered or taken.
<br><br>
<<link "Part ways">><<set $pe to 4>><<goto "MainMissionStart">><</link>>
<<elseif $pe eq 7>>
<div style="text-align:center;">
<h2 class="town-title">Street Performers & Whispers</h2>
</div>
The streets near the tournament sector are alive with performers. Fire-breathers spit flames into the night. Musicians play instruments that seem to bend reality slightly with each note. Dancers move in ways that shouldn’t be physically possible—their bodies enhanced by qi, blurring the line between acrobatics and cultivation technique.
<br><br>
You wander among them, watching.
<br><br>
Near a shadowed alley you notice a different kind of transaction. A delicate-featured young man in expensive purple-and-black robes is speaking quietly with other cultivators. When he notices your interest he gestures you over with a lazy, inviting smile.
<br><br>
<<link "Approach the young man">><<set $pe to 7.1>><<goto "MainMissionStart">><</link>>
<br>
<<link "A scarred woman runs a different kind of trade nearby">><<set $pe to 7.2>><<goto "MainMissionStart">><</link>>
<br>
<<link "Ignore them and continue exploring">><<set $pe to 4>><<goto "MainMissionStart">><</link>>
<<elseif $pe eq 7.1>>
His robes are expensive, dyed in shades of purple and black. His fingernails are painted. He moves with practiced grace—the kind of beauty that’s carefully cultivated, a weapon as dangerous as any blade.
<br>
<span class="male">"Looking for something the open stalls don’t sell?"</span> he asks, voice like honey.
<br>
<span class="player">"Depends what you’re offering."</span>
<br>
He smiles. <span class="male">"I arrange private dual-cultivation sessions. Dark ones. The kind that leave marks on more than just the body. Some people come to me because they want to be used. Some come because they want to use someone else. Either way… I make sure it happens."</span>
<br><br>
He leans against the alley wall, studying you.
<br>
<span class="male">"So tell me, little cultivator… which one are you?"</span>
<br><br>
<<link "Tell him you want to be the one in control">><<set $pe to 7.11>><<goto "MainMissionStart">><</link>>
<br>
<<link "Tell him you’re curious what it feels like to be used">><<set $pe to 7.12>><<goto "MainMissionStart">><</link>>
<br>
<<link "Keep it neutral—ask for mutual exchange only">><<set $pe to 7.13>><<goto "MainMissionStart">><</link>>
<br>
<<link "Decline and walk away">><<set $pe to 4>><<goto "MainMissionStart">><</link>>
<<elseif $pe eq 7.11>>
<span class="player">"I want someone who won’t break the moment I push."</span>
<br><br>
His laugh is soft and delighted. He leads you deeper into the alley, then into a small rented room above a closed shop. The moment the door closes you shove him to his knees. You force his face between your thighs and hold him there, grinding down until he’s gasping and drooling. Every time he tries to pull back you tighten your grip in his hair and ride his tongue harder.
<br><br>
You refuse to let him touch himself. You make him stay on his knees with his hands behind his back while you use his mouth and face for your own pleasure. You edge him with words alone—telling him exactly how pathetic the pretty little dual-cultivation broker looks when he’s reduced to a wet, whimpering seat for a woman’s cunt.
<br><br>
You finish on his tongue, then leave him there on the floor, cock still hard and untouched, eyes glassy with frustrated need.
<br>
<span class="player">"Survive the tournament. Maybe I’ll let you finish next time."</span>
<br><br>
<<link "Leave the alley">><<set $pe to 4>><<goto "MainMissionStart">><</link>>
<<elseif $pe eq 7.12>>
<span class="player">"I… want to know what it feels like when someone doesn’t stop."</span>
<br><br>
Something hungry flashes in his eyes. He doesn’t answer with words. He simply grabs your wrist and pulls you deeper into the alley, away from every light and every possible witness.
<br><br>
He shoves you hard against the cold stone. His mouth finds your neck and he bites down hard enough to bruise. When you make a sound of protest he covers your mouth with one hand and tears at your robes with the other.
<br>
<span class="male">"You already asked for this."</span>
<br><br>
He forces your legs apart and drives into you in one brutal thrust. It’s violent—the kind of taking that lives right on the edge of pain. He fucks you hard and fast against the wall, one hand over your mouth, the other pinning your wrists above your head. Every time you struggle he bites harder or thrusts deeper until the fight drains out of you and your body starts answering him anyway.
<br><br>
He finishes inside you with a low groan, then steps back and adjusts his robes like nothing happened.
<br>
<span class="male">"We’re connected now, little whore. Survive the tournament. I’ll be waiting."</span>
<br><br>
You’re left trembling against the stone, robes torn, thighs wet with him and your own unwanted arousal, neck bleeding from his teeth.
<br><br>
<<link "Collect yourself and leave">><<set $pe to 4>><<set $nonConsensualEncounter to true>><<goto "MainMissionStart">><</link>>
<<elseif $pe eq 7.13>>
<span class="player">"Mutual only. Nothing forced."</span>
<br><br>
He studies you for a long moment, then nods. <span class="male">"Rare, but I can work with rare."</span>
<br><br>
The room he takes you to is simple. The dual cultivation that follows is intense but carefully balanced—hands and mouths and qi circulating between you in equal measure. He never pushes past the boundaries you set. When it’s over he looks almost disappointed, but he still presses a soft kiss to the inside of your wrist.
<br>
<span class="male">"If you ever change your mind about the darker options… you know where to find me."</span>
<br><br>
<<link "Return to your quarters">><<set $pe to 4>><<goto "MainMissionStart">><</link>>
<<elseif $pe eq 7.2>>
She’s older, perhaps in her fifties, with a weathered face that suggests years of living by her wits. One eye is clouded—a cultivation injury that never healed properly.
<br>
<span class="female">"You’re not here for pills,"</span> she says immediately, reading you. <span class="female">"Pills are for people who are still pretending they’re on the righteous path."</span>
<br><br>
She settles onto a crate. <span class="female">"I sell information instead. Secrets about cultivators in the tournament. Weaknesses. Scandals. Things that could help you predict patterns, win matches."</span>
<br>
<span class="player">"And what do you want in return?"</span>
<br>
She smiles, showing teeth stained from years of chewing betel nut. <span class="female">"Stories. Your story. Tell me something true about yourself, and the information is yours."</span>
<br><br>
<<if $corruption gte 70>>
<<link "Trade her a dark confession">><<set $pe to 7.21>><<goto "MainMissionStart">><</link>>
<<else>>
<<link "Offer a safer truth">><<set $pe to 7.22>><<goto "MainMissionStart">><</link>>
<</if>>
<<elseif $pe eq 7.21>>
You sit beside her on the crate. <span class="player">"I’ve consumed human essence. Deliberately. For power."</span>
<br><br>
She doesn’t look shocked. <span class="female">"I know. I can see it in the way the Qi around you smells—burnt flesh and desperation."</span>
<br><br>
She produces a small notebook, filled with cramped handwriting. <span class="female">"The top three tournament favourites each have weaknesses."</span>
<br><br>
She begins to recite: a cultivator who’s terrified of water; another who has a secret lover they’re desperate to hide; a third who’s using pills to mask an old injury that could be exploited.
<br>
<span class="female">"This knowledge cost you nothing but honesty. That’s rarer than you’d think."</span>
<br><br>
As you’re leaving, she catches your sleeve. <span class="female">"One more thing, cultivator. The path you’re on—it doesn’t lead to the ascension everyone preaches. It leads somewhere darker. If you’re going to walk it, at least walk it fully. Half-measures are what break people."</span>
<br><br>
<<link "Return to your quarters with new knowledge">><<set $pe to 4>><<set $tournamentIntelGained to true>><<goto "MainMissionStart">><</link>>
<<elseif $pe eq 7.22>>
You consider her offer. <span class="player">"I’m here because I’m searching for something. Something the tournament can’t give me, but maybe winning it will bring me closer."</span>
<br><br>
She nods slowly, as if this satisfies her. <span class="female">"That’s true enough."</span>
<br><br>
She gives you limited information—nothing devastating, but useful. The names of a few cultivators to watch, their general cultivation realms, nothing that feels particularly secret.
<br><br>
But as you leave, you have the sense that she’s watching your back, assessing, judging.
<br><br>
<<link "Return to your quarters">><<set $pe to 4>><<goto "MainMissionStart">><</link>>
<<elseif $pe eq 8>>
<br>After taking part with preliminary rounds you found that your opponents were rather dissapointing. You were able to defeat them with ease, without revealing any of your techniques. None of them were able to withstand more than a few exchanges. You are now waiting for your turn at quarter finals.
<br>
<br>You are standing in the dark corner of tournament arena, watching matches unfold. The crowd is cheering, but you are focused on the next match. You can feel the tension in the air, the anticipation of the next battle. You know that your next opponent will be stronger, more skilled, and more dangerous. You take a deep breath and prepare yourself for what is to come.
<br>
<br>Finally you hear announcer's voice, calling your name. You step forward, ready to face your next opponent. The crowd cheers as you enter the arena, and you can feel the eyes of everyone on you. You take a deep breath and focus on the task at hand. This is it. The quarter finals. The moment that will determine your fate in the tournament.
<<applyWorldDifficultyScaling 2 false>>
<<CreateNPC001>>
<<BeforeBattle>>
<<set $returnpassage to passage()>>
<br><<link "Step into the arena and face your opponent">><<set $pe to 0>><<set $nextPe to 9>><<set $timeToTournament to "prelim">><<goto "Battle">><</link>>
<<elseif $pe eq 9>>
<<AfterBattle>>
<div style="text-align:center;">
<h2 class="town-title">Quarter finals</h2>
<div style="font-size: 0.9em; color: #c5a059; margin-top:-5px;"></div>
</div>
The official raises your arm high into the air.
<br><span class="male">"$playerfullname advances to the Semi Finals!"</span>
<br>
Thunderous applause erupts throughout the arena.
<br>
Some spectators shout your name. Others whisper among themselves.
<br><span class="male">"Who is that cultivator?"</span>
<br><span class="male">"I've never heard of them before."</span>
<br><span class="male">"Their movement technique is extraordinary..."</span>
<br>
High above the arena... Several sect elders quietly exchange glances.
<br><span class="male">"Interesting."</span>
<br><span class="male">"Perhaps we've underestimated this year's tournament."</span>
<br>As you leave the arena, you notice a familiar young cultivator leaning against a stone pillar. Shen Tian. He silently nods toward you.
<br><span class="male">"Congratulations."</span>
<br><span class="male">"I'll be waiting in the Finals."</span>
<br>
Without waiting for your answer... he calmly walks away.
<br>
For some reason... his words feel less like arrogance... and more like certainty.
You go to rest area and prepare for your next announcement.
<<applyWorldDifficultyScaling 2 false>>
<<CreateNPC001>>
<<BeforeBattle _npc 0.7 0.9>>
<br> Untill you're hearing your name at <<link "stage..." "Battle">><<set $pe to 0>><<set $nextPe to 11>><<set $timeToTournament to "semi">>
<<goto "Battle">><</link>>
<<elseif $pe eq 10>>
Your final strike narrowly misses.
<br> Liu Zhen's spear stops only a finger's width from your throat.
<br> The arena falls silent.
<br> Neither of you moves.
<br> Finally... the tournament official steps forward.
<br><span class="male">"Victory..."</span>
<br><span class="male">"Liu Zhen!"</span>
<br> The crowd erupts into applause.
<br>For a brief moment... disappointment washes over you.
<br>
Liu Zhen lowers his weapon immediately. He offers you a hand.
<br><span class="male">"Another day..."</span>
<br><span class="male">"The outcome may have been different."</span>
<br>
You accept his hand.
<br><span class="player">"I still have much to learn."</span>
<br>
Liu Zhen smiles.
<br><span class="male">"Then continue climbing."</span>
<br><span class="male">"One defeat doesn't decide a cultivator's future."</span>
<br>
As you leave the arena... many spectators still applaud your performance.
<br><span class="male">"That was incredibly close."</span>
<br><span class="male">"That wandering cultivator almost defeated Liu Zhen..."</span>
<br><span class="male">"Next tournament, they may become champion."</span>
<br>
Even in defeat... your name has begun spreading throughout Northern Phoenix City.
<br>
Near the arena entrance, Shen Tian silently watches you approach. He studies you for a moment before speaking.
<br><span class="male">"You're stronger than today's result suggests."</span>
<br> You raise an eyebrow.
<br><span class="player">"Comforting words?"</span>
<br>
A faint smile appears on his face.
<br><span class="male">"No."</span>
<br><span class="male">"An observation."</span>
<br>He looks toward the arena.
<br><span class="male">"Whether you won or lost..."</span>
<br><span class="male">"I wanted to fight you."</span>
<br> Without another word... he walks toward the preparation area for his own match.
<br> You watch him leave.
<br> For reasons you cannot explain... a strange feeling settles within your heart.
<br> Almost as though... this won't be the last time your paths cross.
<br> <<link "Skip to finals..." "MainMissionStart">><<set $pe to 13>><</link>>
<<elseif $pe eq 11>>
<div style="text-align:center;">
<h2 class="town-title">Semi finals</h2>
<div style="font-size: 0.9em; color: #c5a059; margin-top:-5px;"></div>
</div>
Several exhausting exchanges later... your opponent stumbles backwards. Their weapon slips from trembling fingers.
<br> For several seconds... neither of you moves.
<br> Finally... they smile.
<br><span class="male">"...I concede."</span>
<br> Thunderous applause explodes throughout the arena.
<br> The official raises your arm.
<br><span class="powerful">"$playerfullname advances to the Grand Final!"</span>
<br> Your heart pounds heavily.
<br> Only one battle remains.
<br> High above... you notice Shen Tian watching silently from the opposite preparation platform.
<br>He offers you a small nod.
<br>It almost feels... like a promise.
<br>You go to rest area and prepare for your next announcement.
<<applyWorldDifficultyScaling 2 false>>
<<CreateNPC001>>
<<BeforeBattle _npc 0.5 0.7>>
<br> Untill you're hearing your name at <<link "stage..." "Battle">><<set $pe to 0>><<set $nextPe to 13>><<set $timeToTournament to "semi">>
<<goto "Battle">><</link>>
<<elseif $pe eq 12>>
<br>At last... your knees give way.
<br> Your opponent's blade stops just short of your neck.
<br> The official raises a hand.
<br><span class="male">"Victory!"</span>
<br>Applause echoes throughout the arena.
<br>
Although disappointed... you cannot help smiling.
<br>You came farther than anyone expected.
<br>Even several sect elders quietly nod in approval.
<br>Your tournament journey has come to an end.
<br>Yet... for some reason... your eyes drift toward Shen Tian.
<br>
His match is about to begin.
<br> <<link "Skip to finals..." "MainMissionStart">><<set $pe to 13>><</link>>
<<elseif $pe eq 13>>
The final preparations quickly begin. The arena buzzes with excitement. >Merchants abandon their stalls. Even the sect elders rise from their seats.
<br>Every eye is fixed upon the arena. Only two competitors remain. Shen Tian calmly steps into the center of the arena. His opponent follows shortly behind.
<br>Neither has drawn a weapon.
<br>The referee raises his hand.
<br><span class="powerful">"The Grand Final shall now—"</span>
<br>
<br>
<<linkreplace "...">>
<br>
<br> A suffocating pressure descends upon the world. The referee suddenly falls silent. The sunlight disappears. The entire arena is swallowed by an unnatural shadow.
<br> You instinctively look toward the sky. The clouds slowly begin to part. An enormous golden gate reveals itself beyond the heavens.
<br> Your heart nearly stops. You've seen this before.
<br> The hidden tomb.Willow Creek Village.Yu Wei's memories.The Harvest.
<br> Without warning, the Phoenix Sigil branded upon your soul burns with searing heat. A sharp pain spreads through your chest. Every instinct screams at you...
<br> Hide.Remain silent. Do not draw attention.An overwhelming Heavenly pressure crashes over Northern Phoenix City. Thousands of cultivators immediately fall to one knee. Sect elders bow deeply. The City Lord lowers his head without hesitation. Even Nascent Soul experts dare not look directly toward the heavens.
<br> You grit your teeth. Your legs tremble violently beneath the crushing pressure. Every part of your body urges you to kneel.
<br> After several agonizing moments...
<br> You can no longer resist.
<br> You slowly lower yourself to one knee.
<br><<linkreplace "As you do...">>
<br> Golden light descends upon Shen Tian. The entire arena erupts into celebration.
<br><span class="crowd">"A Heavenly Chosen!"</span>
<br><span class="crowd">"Heaven has blessed our region!"</span>
<br><span class="crowd">"Such fortune! Such glory!"</span>
<br> Shen Tian doesn't celebrate. He stares at the descending light. His confident expression slowly fades. Confusion. Then unease. Then fear.
<br> Golden chains emerge from the light itself. They gently wrap around his wrists. His breathing quickens.
<br><span class="male">"...This..."</span>
<br> He struggles slightly. The chains tighten. His pupils shrink.
<br><span class="male">"...No..."</span>
<br> For the first time since meeting him... You see genuine terror in Shen Tian's eyes. He desperately scans the crowd.
<br> Thousands of people cheer. Thousands kneel in admiration. Not one of them notices. His gaze finally meets yours. His lips barely move.
<br><span class="male">"...Help..."</span>
<br> You instinctively tense your muscles. The Phoenix Sigil suddenly burns hotter than ever. The pain is unbearable. Your body refuses to move. Whether it is fear...
<br>The Sigil's warning...Or simply the overwhelming Heavenly pressure...You cannot tell.
<br>The only thing you know......is that moving now would mean certain death.
<br>Golden light engulfs Shen Tian completely. His body slowly ascends toward the Heavenly Gate. He never looks away from you.
<br>A moment later...
<br>He disappears beyond the golden clouds. The gate slowly closes. The crushing pressure vanishes. Sunlight returns to Northern Phoenix City. It is as though nothing ever happened. Thunderous applause shakes the arena. The referee wipes tears from his eyes.
<br><span class="powerful">"What an honor..."</span>
<br><span class="powerful">"Another genius has been welcomed into the Heavenly Realm."</span>
<br>You slowly rise to your feet. Your chest still aches where the Phoenix Sigil burned. You look around the arena. Nobody questions what happened. Nobody wonders where Shen Tian has gone. Nobody notices the fear that filled his final moments. They simply celebrate.
<br>For the first time...
<br>You realize there may be only two kinds of cultivators.
<br>Those destined to ascend...
<br>
<br>And those willing to defy destiny itself.
<<link "Leave Northern Phoenix City" "Map|Region1">>
<<unset $battleRound>>
<<set $mainStage = 3>>
<<set $missionTournamentComplete = true>>
<<set $pe = 0>>
<<LogEvent "story" "The Heavenly Selection" "The Regional Martial Tournament ended in celebration after the gifted cultivator Shen Tian was chosen by Heaven itself. While the crowd rejoiced, you alone witnessed the fear in his eyes as golden chains carried him beyond the Heavenly Gate. Whatever truly awaits those who ascend, you have resolved to uncover it." 1>>
<</link>>
<</linkreplace>>
<</linkreplace>>
<</if>>
<</if>>
<<if $mainStage eq 3>>
<<if $inspectorStage is undefined or $inspectorStage < 1>>
The road away from Northern Phoenix City feels strangely quiet. Only a few days have passed since the tournament, yet the events refuse to leave your mind – the golden gate, the Heavenly light, Shen Tian's expression, the fear hidden beneath everyone's celebration. The world called it an honor, a blessing, a miracle. But you saw someone being taken.
<br><br>
You continue walking until the forest suddenly falls silent. No insects. No birds. Not even the wind moves. Your hand instinctively moves toward your weapon.
<br><br>
Then a voice comes from behind you.
<br><span class="male">"Interesting."</span>
<br><br>
You turn immediately. A man stands beneath the trees. You did not hear him approach. His robes are pure white, decorated with golden patterns like countless stars. His expression is calm, almost peaceful. But your instincts scream – the pressure surrounding him is beyond anything you have ever felt.
<br><br>
He smiles slightly. <span class="male">"Do not be alarmed. If I intended to harm you, you would not have noticed my arrival."</span> The statement is spoken without arrogance – simply a fact.
<br><br>
<span class="player">"Who are you?"</span>
<br>
The man places one hand over his chest. <span class="male">"I am a Heavenly Inspector. An observer sent from the Upper Realm."</span>
<br><br>
Your heart tightens. The Phoenix Sigil burns faintly. The Inspector notices, his eyes narrowing with curiosity rather than anger.
<br><span class="male">"So it is true."</span>
<br><span class="player">"What is true?"</span>
<br>
He walks closer. <span class="male">"The Phoenix legacy survived."</span>
<br><br>
A heavy silence follows.
<br><span class="player">"You know about the Blazing Phoenix Sect?"</span>
<br>
For the first time, his expression changes – a hint of sadness. <span class="male">"Many things have been lost since that era. Even the Upper Realm remembers those who opposed Heaven."</span>
<br><br>
You immediately become alert. <span class="player">"Opposed Heaven?"</span>
<br>
The Inspector looks toward the sky. <span class="male">"Mortals often misunderstand rebellion. They believe those who challenge Heaven must hate Heaven."</span> He looks back at you. <span class="male">"That is not always true."</span>
<br><br>
Before you can ask more, a golden mark appears above his palm – the same energy you felt during Shen Tian's ascension. The Phoenix Sigil burns in response.
<br><br>
<span class="male">"Curious. The Heavenly Gate attempted to recognize you as well."</span>
<br>
A cold feeling spreads through your body. <span class="player">"Recognize?"</span>
<br>
The Inspector tilts his head. <span class="male">"Yes. You should feel honored. Few mortals are noticed by Heaven."</span> His words sound sincere – not mocking, not threatening. He truly believes this. That unsettles you more than hatred would.
<br><br>
<<link "Question him about ascension">>
<<set $inspectorStage = 1>>
<<set $heavenKnowledge += 1>>
<<goto "MainMissionStart">>
<</link>>
<br>
<<link "Accuse Heaven of stealing cultivators">>
<<set $inspectorStage = 2>>
<<set $heavenKnowledge += 1>>
<<set $heavenSuspicion += 1>>
<<goto "MainMissionStart">>
<</link>>
<br>
<<link "Remain silent and observe him">>
<<set $inspectorStage = 3>>
<<goto "MainMissionStart">>
<</link>>
<<else>>
/* Inspector response and continuation */
<<if $inspectorStage is 1>>
<span class="player">"What happens after someone ascends?"</span>
<br>
The Inspector is silent for a moment, then speaks. <span class="male">"They leave behind suffering. They leave behind weakness. They become something greater."</span> He genuinely believes every word.
<<elseif $inspectorStage is 2>>
<span class="player">"You call it ascension. I call it taking people away."</span>
<br>
The forest falls silent. The Inspector studies you. <span class="male">"Ah. So the Phoenix memories reached you."</span> His expression becomes more serious. <span class="male">"Be careful with incomplete truths."</span>
<<elseif $inspectorStage is 3>>
You say nothing. The safest answer is sometimes no answer. The Inspector smiles slightly. <span class="male">"Wise. Curiosity has destroyed many talented cultivators."</span>
<</if>>
<br><br>
The Inspector turns away. <span class="male">"Regardless of your beliefs, I did not come here to argue. I came to investigate."</span>
<br><span class="player">"Investigate what?"</span>
<br>
He looks directly at the Phoenix Sigil. <span class="male">"You."</span>
<br><br>
Your expression hardens. <span class="male">"A remnant of the Blazing Phoenix Sect should not exist. Yet here you stand, carrying an artifact created during the rebellion."</span>
<br><br>
He takes a step closer, the pressure almost unbearable. <span class="male">"Tell me… who gave you that power?"</span>
<br><br>
You hesitate. You cannot reveal Yu Wei – not yet. The Inspector watches your silence, then unexpectedly smiles.
<br><span class="male">"Interesting. You are protecting someone who has been dead for thousands of years. That is either foolish… or admirable."</span>
<br><br>
The golden mark in his hand disappears. <span class="male">"I will report that the Phoenix inheritance remains incomplete. For now."</span>
<br><br>
The meaning behind those words is obvious: he is letting you go, but only temporarily. Before leaving, he pauses.
<br><span class="male">"One warning, mortal. Do not assume Heaven is your enemy simply because you do not understand it. Many have destroyed themselves chasing truths they were not prepared to carry."</span>
<br><br>
Golden light surrounds him. <span class="male">"We will meet again."</span>
<br><br>
The light fades. The forest returns to normal. You remain alone, but now you know something important: Heaven knows you exist. And they are watching.
<br><br>
<<link "Continue your journey" "Map|Region1">>
<<unset $battleRound>>
<<set $mainStage = 4>>
<<set $missionInspectorComplete = true>>
<</link>>
<</if>>
<</if>>
<<if $mainStage eq 4>>
<<if $pe eq 0>>
The pull of the Phoenix Sigil grows stronger the further you travel from civilisation. It leads you into a forgotten valley, hidden between jagged peaks that seem to lean away from the sky. The air here is wrong – not stale, not poisoned, but *incomplete*, as if sound itself has been surgically removed.
<br><br>
At first glance the valley is empty. No ruins. No bones. Just grass and silence. But the Sigil burns against your chest, and the world begins to tear.
<br><br>
Reality folds like old silk. Where there was nothing, now there are echoes. A staircase rises halfway toward the clouds and stops, its upper steps missing – not broken, not collapsed, simply *never built*. A sword thrust into the earth has only half a blade; the rest is gone, the cut so clean that light itself hesitates at the edge. A faceless statue of a phoenix‑robed woman stares into a void that should hold her expression.
<br><br>
You are standing inside the wound left by Heaven's erasure.
<br><br>
<<link "Walk through the half‑real ruins">>
<<set $pe = 1>>
<<goto "MainMissionStart">>
<</link>>
<<elseif $pe eq 1>>
Your footsteps echo oddly, sometimes arriving before your feet touch the ground. You find fragments of memory pressed into the stone – words from people who no longer exist.
<br><br>
A shattered tablet reads:
<br><span class="soul">"We have found it. The cycle is older than Heaven. The immortal realms are not the beginning. There is something beneath them, and they are afraid."</span>
<br><br>
Further on, a single line carved by a trembling hand:
<br><span class="soul">"The Sovereign said we must not destroy the gate. We must *open* it. But Heaven would rather unmake us than let us look."</span>
<br><br>
You press deeper. The air grows colder. Finally you reach a wall that still stands – a mural of a burning phoenix, its wings spread in desperate flight. Beneath it, a name is etched over and over, as if repetition could resist erasure:
<br><span class="soul">"Yu Wei. Yu Wei. Yu Wei."</span>
<br><br>
Your Sigil flares, and a hidden seam of golden light cracks open in the stone. A passageway, sealed so deeply that Heaven could not reach it.
<br><br>
<<link "Enter the sealed passage">>
<<set $pe = 2>>
<<goto "MainMissionStart">>
<</link>>
<<elseif $pe eq 2>>
The passage spirals down into absolute darkness. When you emerge, you are standing in a circular chamber whose walls are covered in star charts that move slowly, tracking constellations that no longer exist.
<br><br>
A recording formation hums to life. It holds one final message – the last official act of the Blazing Phoenix Sect before Heaven wiped it from the world.
<br><br>
<span class="soul">"If you hear this, then we have already been forgotten. Do not mourn us. We lost not because we were weak, but because we discovered the truth too late. Heaven does not fear armies. It fears questions. We asked the oldest question of all: *What lies beyond the cycle?* And for that, they unmade us. But we prepared for this. In a chamber beneath the Phoenix Throne, we hid a seed that no hand of Heaven could touch. If you carry our sigil, it will open for you. Find it. Finish what we could not."</span>
<br><br>
The formation crumbles. The chamber begins to fade, the reality of the erasure trying to swallow it. You barely escape before the passage collapses.
<br><br>
You know now where to go: the sealed chamber beneath the Phoenix Throne – the heart of the old sect's legacy, hidden deeper than the ruins themselves.
<br><br>
<<link "Return to the surface" "Map|Region1">>
<<set $phoenixRuinsFound = true>>
<<set $pe = 0>>
<<set $mainStage = 5>>
<<unset $battleRound>>
<<LogEvent "story" "The Phoenix Ruins" "Beneath a valley erased by Heaven, you discovered fragments of the Blazing Phoenix Sect's final days. They were unmade not for rebellion, but for asking questions Heaven could not allow. You now know the location of the Phoenix Sovereign's sealed chamber, hidden deeper than the erasure could reach." 1>>
<</link>>
<</if>>
<</if>>
<<if $mainStage eq 5>>
<<if $pe eq 0>>
The location burned into your memory lies at the heart of the erased valley, beneath a throne that no longer exists in the world above. But the Phoenix Sigil knows the way. It guides you not by sight, but by absence – the *lack* of spiritual pressure where something powerful once stood.
<br><br>
You descend through layers of fractured space until you stand before a door that is not a door. It is a wound in reality, sealed with a flame that does not burn. The Sigil answers it, and the wound opens.
<br><br>
Inside, time has stopped. The chamber is untouched by the erasure, preserved in the final heartbeat before Heaven's obliteration. A throne of black iron sits at its centre, empty. A broken crown rests upon the seat. And hovering above it, a single phoenix feather, still glowing with a heat that has outlasted millennia.
<br><br>
<<link "Approach the throne">>
<<set $pe = 1>>
<<goto "MainMissionStart">>
<</link>>
<<elseif $pe eq 1>>
The feather descends as you draw near. It does not burn you. It settles into your palm like it was always meant to be there, and a voice fills the chamber – calm, measured, utterly certain.
<br><br>
<span class="soul">"You are not of our blood. You are not of our era. That is precisely why I chose you."</span>
<br><br>
The Phoenix Sovereign. Not a ghost, not a soul fragment – only a message, crafted with such precision that it would survive even the erasure of its maker.
<br><br>
<span class="soul">"Yu Wei was my shield. He believed the fight was against Heaven. I knew otherwise. The enemy is not the Upper Realm. It is a cycle that has consumed countless worlds before ours, and will consume countless more. I sought a third path – not submission, not destruction, but transformation."</span>
<br><br>
The feather glows brighter. Images flood your mind: a vast, dying tree whose roots drink from entire realms; a clockwork mechanism at the centre of creation, slowly grinding worlds to dust; and countless seeds like the one now stirring in your chest – Sovereign Cores, planted at the root of every power that has ever endured across the higher realms.
<br><br>
<span class="soul">"You misunderstand what you carry. A Sovereign Core is not some singular miracle set aside for chosen heroes. Every sect of true consequence – every power that has outlasted its founders – was built upon one. Ours is no different in kind. What makes it different is its blood. This Core remembers the Blazing Phoenix Sect. It remembers what we asked, and what we paid for asking it."</span>
<br><br>
The voice grows distant, as if recalling a place from memory rather than describing one.
<br><span class="soul">"There is a region beyond this one, further from the mortal roads you have walked – a place of older sects and stronger foundations, where cultivators are not born crawling but already stand in the higher realms by the time they draw their first breath there. It is not hidden. It is not lawless. It is simply *further*, and Heaven's grip loosens the further one travels from its throne. Heaven still walks freely through that region, as it does through this one and the one beyond it – but there, it is only one power among several, not the only one. Carry the Core there. Find ground that has never been claimed, and build your sect the way any sect is built – openly, through disciples, trials, and years of patient growth. Its foundation will simply remember more than most."</span>
<br><br>
The feather dissolves, and the chamber begins to fade. But something has changed inside you. The Sovereign Core, dormant until now, awakens fully – its roots entwining with your cultivation, ready to be planted.
<br><br>
<<link "Leave the collapsing chamber" "Map|Region1">>
<<unset $battleRound>>
<<set $sovereignAwakened = true>>
<<set $pe = 0>>
<<set $mainStage = 6>>
<<LogEvent "story" "The Phoenix Sovereign's Legacy" "In a chamber hidden from Heaven's erasure, you received the final message of the Phoenix Sovereign. The Sovereign Core is not a unique relic but a foundation shared by great sects across the higher realms – yours is set apart only by the memory it carries. You are to plant it in the region beyond and build your sect there, openly, as any sect is built." 1>>
<</link>>
<</if>>
<</if>>
<<if $mainStage eq 6>>
<<if $pe eq 0>>
You emerge from the ruins to find the sky waiting. Not with clouds, but with a single figure, standing in the air as if the wind itself holds him up. The Heavenly Inspector. His expression is unchanged – calm, polite, faintly sad – but something is different. He is no longer alone.
<br><br>
Behind him, the air shimmers. You cannot see them clearly, but you *feel* them: forms of golden light, utterly silent, utterly still. Executioners.
<br><br>
<span class="male">"I had hoped you would reconsider,"</span> the Inspector says. His voice carries no malice. <span class="male">"The Phoenix inheritance could have been brought into the light. You could have served something greater. Instead, you delved into the erased places and awakened what should have remained sealed."</span>
<br><br>
He descends until he is standing just a few paces away. The pressure is immense, but it is not aggressive – it is merely the weight of his attention.
<br><br>
<span class="male">"I am not your enemy. I am an observer. But I am also a servant of Heaven. And Heaven has decided that the Blazing Phoenix Sect must not rise again. You have one chance. Surrender the Sovereign Core, and I will argue for your life. Refuse…"</span> He gestures to the golden shapes behind him. <span class="male">"…and they will end this threat."</span>
<br><br>
<<link "Refuse to surrender">>
<<set $pe = 1>>
<<goto "MainMissionStart">>
<</link>>
<br>
<<link "Attempt to negotiate">>
<<set $pe = 2>>
<<goto "MainMissionStart">>
<</link>>
<<elseif $pe eq 1>>
<span class="player">"I've seen what Heaven calls mercy. I won't give you the core."</span>
<br><br>
The Inspector sighs. It is a genuine sound, tinged with regret. <span class="male">"Then you leave me no choice."</span>
<br><br>
He raises his hand, and the executioners begin to solidify. But then he pauses. He looks at you – not as a threat, but as a puzzle.
<br><span class="male">"You truly believe you are righteous. That is… rare. Most who defy Heaven do so out of greed or madness. You do it out of conviction."</span>
<br><br>
He lowers his hand. The executioners freeze.
<br><span class="male">"Very well. I will give you a chance – not because I approve of your path, but because I am curious to see where it leads. Leave this region. Tonight. Heaven walks every road here, and further still – but the region beyond is where our attention thins, where older sects hold ground we do not contest lightly. If you remain within my direct sight, my superiors will send someone less… curious. Go there. Build in the open if you wish; a new sect among many draws less notice than one hiding in the erased places. It is only Heaven's *particular* notice you must avoid, and even that fades the deeper you go – until you reach the region where Heaven does not walk alone even among its own kind."</span>
<br><br>
He steps back. <span class="male">"Go. Build your sect if you must. The cycle will judge you in time."</span>
<br><br>
He vanishes, taking the executioners with him. But as the pressure lifts, you feel something settle on your skin – a faint golden mark, invisible to mortals but impossible to miss for anything with divine sight. You are now known. And you are being watched.
<br><br>
<<link "Prepare for the journey" "Map|Region1">>
<<unset $battleRound>>
<<set $heavenMarked = true>>
<<set $pe = 0>>
<<set $mainStage = 7>>
<<set $readyForRegion2 = true>>
<<LogEvent "story" "The Breaking Point" "Heaven's Inspector confronted you after you awakened the Sovereign's legacy. He offered one chance to leave for the region beyond, where Heaven's attention thins among older, established sects. You are now marked, and the clock is ticking." 1>>
<</link>>
<<elseif $pe eq 2>>
<span class="player">"You're not a butcher. I see it in your eyes. You've watched this cycle for centuries – you must have doubts."</span>
<br><br>
The Inspector's expression flickers, the first crack in his calm. <span class="male">"…Doubts are a luxury I cannot afford. I observe. I report. I do not judge."</span>
<br><br>
<span class="player">"Then observe this: I'm not your enemy. I want to understand what's broken, not smash it. Let me go where I can build without Heaven watching my every step, and I'll find answers – maybe even ones you've been afraid to look for."</span>
<br><br>
Silence. Then, very quietly: <span class="male">"…The region beyond this one. Heaven still walks it, as it walks everywhere short of its own throne – but there it shares the ground with sects far older than mine to interfere with. If you go there, I can report that the trail went cold among a hundred others like it."</span>
<br><br>
He meets your eyes one last time. <span class="male">"Do not mistake this for alliance. I am merely… curious."</span>
<br><br>
The executioners shimmer and vanish. He follows a moment later. You are left with a golden mark on your skin – a tracker, or perhaps a sign that you have been noticed by someone who might one day be more than an observer.
<br><br>
<<link "Prepare for the journey" "Map|Region1">>
<<unset $battleRound>>
<<set $heavenMarked = true>>
<<set $inspectorRespect = true>>
<<set $pe = 0>>
<<set $mainStage = 7>>
<<set $readyForRegion2 = true>>
<<LogEvent "story" "The Breaking Point" "You negotiated with the Heavenly Inspector, appealing to his buried doubts. He granted you leave to travel to the region beyond, where Heaven shares ground with older sects. A strange, tense understanding has formed between you and this servant of Heaven." 1>>
<</link>>
<</if>>
<</if>>
<<if $mainStage eq 7 and $readyForRegion2 eq true>>
<<if $pe eq 0>>
<<set $playerX to 0>>: X
<<set $playerY to 8>>: Y
<<link "Ascent to higher realm" "Map|Region1">>
<<set $MapRegion to "Region2">>
<<set $map = [
[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],
[-1, 0, 0, 0,-1,-1,-1,-1,-1,-1,-1,-1, 0,-1],
[ 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-1],
[ 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-1],
[ 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-1],
[ 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,-1],
[ 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-1],
[ 1, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0,-1],
[ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-1],
[ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-1],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,-1],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-1],
[ 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,-1],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2,-1]
]>>
<</link>>
<</if>>
<</if>><<set $mainStageStarted = "false">>
<<set $mainStage = 0>><<set $missionpassage to passage()>>
<!-- ROGUE CULTIVATOR MISSION EXAMPLE -->
<<if $activeSideMission.id eq "killRogueCultivator01">>
<<if $pe eq 0>>
The moment you step into the clearing, the atmosphere thickens with killing intent. A faint metallic scent lingers in the air—blood, fresh and unclean.
In the distance, a lone figure stands atop a jagged stone. His robes are tattered, eyes wild with madness. Blackened qi coils around him like serpents, writhing with instability.
His cultivation has clearly deviated from the righteous path.
As his gaze locks onto yours, a wicked grin spreads across his face.
<!-- CRITICAL: Pass mission's enemy realm/stage to CreateNPC001 -->
<<if $activeSideMission.enemyRealm>>
<<set _targetRealm to $activeSideMission.enemyRealm>>
<<set _targetStage to $activeSideMission.enemyStage>>
<</if>>
<!-- Create the enemy NPC -->
<<CreateNPC001>>
<!-- Display what we're facing -->
<div class="enemy-threat-display">
<p><strong>Opponent:</strong> <<print _npc.realm>></p>
<<if $activeSideMission.actualDangerLevel>>
<p><strong>Threat Level:</strong> <<getDangerDisplay $activeSideMission.actualDangerLevel>></p>
<</if>>
</div>
<!-- Begin combat -->
<<BeforeBattle>>
<<link "⚔️ To battle!" "MissionBattle1">>
<<set $passage to "MissionBattle1">>
<<set $pe to 0>>
<<set $nextPe to 1>>
<</link>>
<br><<link "Flee before enemy sees you" "Map|Region1">><</link>>
<<elseif $pe eq 1>>
The rogue cultivator staggers back, coughing blood. His corrupted qi twists violently before dispersing into nothingness.
He falls to his knees, eyes briefly clearing of madness.
<span class="male1">"Perhaps... I was not entirely wrong..."</span> he whispers before collapsing.
You've eliminated the threat!
<<startStatChanges>>
<<gainStat "basemartialArts" "Martial Arts" 2 10 40>>
<<gainExp 600>>
<<set $combatFame += 5>>
<<set $ContributionPoints += 20>>
<<showStatChanges>>
<<set $passage to "Map|Region1">>
<<MissionFinish>>
<<elseif $pe eq 2>>
The rogue cultivator's laughter echoes as your vision fades. His strikes were devastating.
When you awaken, you lie wounded at the edge of the forest, talismans burnt and pride fractured.
The threat still roams...
<<startStatChanges>>
<<gainExp 150>>
<<showStatChanges>>
You have retreated, badly wounded.
<<set $passage to "Map|Region1">>
<<MissionFailed>>
<</if>>
<</if>>
<!--Find Herb-->
<<if $activeSideMission.id eq "findHerb01">>
<<if $pe eq 0>>
The mist clings to your robes as you step into a hidden valley where moonlight filters through jagged cliffs. The air smells faintly of dew and decay.
Somewhere in this eerie stillness lies the <b>Moonshade Lily</b>, a herb that only blooms when starlight aligns with certain celestial veins in the earth.
A faint glow dances between the rocks—just within reach.
Yet something breathes, slow and guttural, in the darkness behind you...
<<link "Reach for the flower carefully" $missionpassage>><<set $pe to 1>><<set $herbApproach to "stealth">><</link>>
<<link "Charge forward and grab it" $missionpassage>><<set $pe to 1>><<set $herbApproach to "brute">><</link>>
<<elseif $pe eq 1>>
<<if $herbApproach eq "stealth">>
<<if $agility >= 6>>
Your movements are fluid as drifting mist.
Whatever creature guarded this place never senses you. You pluck the <b>Moonshade Lily</b>, its petals cool and luminous against your palm.
You leave without a sound — and with your life.
<<MissionFinish>>
<<else>>
A dry twig snaps beneath your foot. The growl comes instantly — guttural, furious.
You snatch the herb and roll away as claws slash your arm.
Blood drips, but so does victory.
Mission complete, though your wound burns faintly with something venomous...
<<set $health to $health - $health*0.1>>
<<MissionFinish>>
<</if>>
<<elseif $herbApproach eq "brute">>
<<if $strength >= 10>>
With a shout, you surge forward, qi blazing.
A monstrous silhouette lunges from the dark — too slow.
One strike of your fist sends it crashing into the rocks. You seize the lily before the dust settles.
<<set $righteousreputation +=1>>
<<MissionFinish>>
<<else>>
The beast is faster than you expected. Its claws tear through your robe as you wrench the flower free.
You stumble out, breath ragged, the <b>Moonshade Lily</b> clutched in bloodied fingers.
The valley claims its toll.
<<set $health to $health - $health*0.2>>
<<MissionFailed>>
<</if>>
<</if>>
<</if>>
<</if>>
<!--Scrool Recovery-->
<<if $activeSideMission.id eq "recoverScroll01">>
<<if $pe eq 0>>
Mist hangs over the quiet riverbank. The water glows faintly blue beneath the moonlight.
Half-submerged among the reeds is a <b>jade scroll case</b>, pulsing faintly with sealing qi.
But something stirs below the surface — the ripples too deliberate, too alive.
<<link "Use a pole to fish it out" $missionpassage>><<set $pe = 1>><<set $scrollMethod = "tool">><</link>>
<<link "Wade into the water to retrieve it directly" $missionpassage>><<set $pe = 1>><<set $scrollMethod = "direct">><</link>>
<<elseif $pe eq 1>>
<<if $scrollMethod is "tool">>
The pole trembles in your hands as you snag the case.
A sudden tug — something beneath the water tries to claim it.
You pull back hard, splashing mud and spray, until the current stills.
You’ve got it.
<<MissionFinish>>
<</if>>
<<if $scrollMethod is "direct">>
<img src="images/Sex/wet.webp" width=80%>
The water grips you with icy fingers as you wade in.
Something brushes your thigh—slick, cold, almost curious.
You snatch the scroll and leap back to the shore, heart pounding, robes soaked and clinging.
<<MissionFinish>>
<</if>>
<</if>>
<</if>>
<!--slay Demonic Beast-->
<<if $activeSideMission.id eq "slayDemonicBeast01">>
<<if $pe eq 0>>
The old shrine lies in ruin.
Statues of forgotten gods crumble beneath black vines; cracked stone bleeds faint red light.
The air stinks of sulfur and death.
Then—a growl.
A creature crawls from the shadows, all bone and sinew, with burning eyes and qi that distorts the air itself.
This demonic beast feeds on sacred resentment, its every breath a curse.
<<link "Confront it head-on" $missionpassage>><<set $pe=1>><<set $approach="fight">><</link>>
<<link "Try to cleanse the shrine before engaging" $missionpassage>><<set $pe=1>><<set $approach="purify">><</link>>
<<elseif $pe eq 1>>
<<if $approach eq "fight">>
The clash is brutal. Each strike shatters rock and burns air.
In the end, you stand over its corpse, demonic ichor sizzling at your feet.
<<MissionFinish>>
<<elseif $approach eq "purify">>
You kneel before the shrine, channeling righteous qi.
The beast screams as the light tears through it—its corruption dissolving into ash.
The shrine’s cracked statues glow faintly, offering silent thanks.
<<set $righteousreputation += 1>>
<<MissionFinish>>
<</if>>
<</if>>
<</if>>
<!--hunt River Serpent-->
<<if $activeSideMission.id eq "huntRiverSerpent01">>
<<if $pe eq 0>>
The river runs red. Torn nets and shattered boats drift by like corpses.
Villagers whisper of a **River Serpent**—its scales shimmer like silver flame, its venom can boil flesh.
As you step to the edge, the current stirs... and the serpent rises, eyes gleaming with old hunger.
<<link "Strike as it surfaces" $missionpassage>> <<set $pe=1>> <<set $serpentAction="attack">> <</link>>
<<link "Wait patiently and bait it with qi" $missionpassage>> <<set $pe=1>><<set $serpentAction="lure">><</link>>
<<elseif $pe eq 1>>
<<if $serpentAction eq "attack">>
You leap before it can fully emerge. Qi flares, scales shatter, and water explodes in a geyser of blood.
You drag its corpse ashore, exhausted but victorious.
<<AddItemToInventory $riverpearlscale>>
<<MissionFinish>>
<<elseif $serpentAction eq "lure">>
You hold your breath, still as stone. When it nears, you strike the water with divine precision.
The beast writhes and retreats into the depths, leaving behind a shimmering scale—a token of grudging respect.
<<AddItemToInventory $serpentmarkscale>>
<<set $insight += 1>>
<<MissionFinish>>
<</if>>
<</if>>
<</if>>
<!--rescue Missing Disciple-->
<<if $activeSideMission.id eq "rescueMissingDisciple01">>
<<if $pe eq 0>>
Fog clings to the cliffs of **Hundred Sorrows Mountain**, damp and suffocating.
You hear faint cries echoing between stone and wind.
Torn talismans, a broken sword, blood on the path… and a weak voice calling from the depths of a cave.
Inside, a many-eyed beast crouches over a wounded disciple.
<<link "Charge in to fight the creature" $missionpassage>> <<set $pe=1>><<set $rescueMethod="fight">><</link>>
<<link "Use stealth to draw it away" $missionpassage>> <<set $pe=1>><<set $rescueMethod="lure">><</link>>
<<elseif $pe eq 1>>
<<if $rescueMethod eq "fight">>
You roar and strike. The creature’s limbs thrash; its eyes burst one by one under your blows.
The disciple trembles but lives. You carry them to safety.
Mission complete.
<<set $righteousreputation += 1>>
<<MissionFinish>>
<<elseif $rescueMethod eq "lure">>
You toss a stone, masking your qi. The beast follows the sound.
You slip in, grab the disciple, and flee before it returns.
Both of you live — but nightmares will remain.
<br><<gainStat "insight" "baseinsight" 1 0 40 "Insight">>
<<MissionFinish>>
<</if>>
<</if>>
<</if>>
<!--collect VenomSacs -->
<<if $activeSideMission.id eq "collectVenomSacs01">>
<<if $pe eq 0>>
The dense forest air is humid and stifling. Glowing mushrooms light your path through a tangle of vines and roots. Beneath your feet, faint skittering warns of nearby danger.
Soon, you hear it—the rhythmic clicking of pincers. Forest scorpions. Their stingers drip with glistening venom, potent enough to melt bone.
You steel yourself. Alchemists pay well for these sacs… but the price is always blood.
The forest is thick with buzzing and clicking sounds. You spot two groups of scorpions clustered near glowing mushrooms.
One group is larger but more aggressive; the other smaller and less active.
<<link "Go for the larger group for more venom" $missionpassage >><<set $pe to 1>><<set $scorpionGroup to "large">><</link>>
<<link "Choose the smaller group for safety" $missionpassage>><<set $pe to 1>><<set $scorpionGroup to "small">><</link>>
<<elseif $pe eq 1>>
<<if $scorpionGroup eq "large">>
The larger group yields plenty of venom sacs, but several scorpions sting you before you can retreat. You manage to escape, wounded but richer.
<<set $health to $health - $health*0.15>>
<<set $gold to $gold + random(50, 70)>>
<<MissionFinish>>
<</if>>
<<if $scorpionGroup eq "small">>
The smaller group is easier to handle. You collect fewer sacs, but return unscathed. The alchemists will pay, though less generously.
<<MissionFinish>>
<</if>>
<</if>>
<</if>>
<!--Other Side Missions-->
<<if $activeSideMission.id eq "sparringPartner01">>
<<JuniorSpar01>>
<</if>>
<<if $activeSideMission.id eq "cleanCourtyard01">>
<<CleanCourtyard01>>
<</if>>
<<if $activeSideMission.id eq "assistAlchemy01">>
<<AssistAlchemy01>>
<</if>>
<<if $activeSideMission.id eq "patrolPerimeter01">>
<<PatrolPerimeter01>>
<</if>>
<<if $activeSideMission.id eq "deliverSupplies01">>
<<DeliverSupplies01>>
<</if>>
<<if $activeSideMission.id eq "tendBeasts01">>
<<TendBeasts01>>
<</if>>
<<if $activeSideMission.id eq "scripturePavilion01">>
<<ScripturePavilion01>>
<</if>>
<<if $activeSideMission.id eq "dormDisturbance01">>
<<DormDisturbance01>>
<</if>><<set $activeSideMission to null>>
<<set $SideMissionStatus to null>>
<!--------------------------------------TOWN SIDE MISSIONS------------------------------>
<<set $sidemissions = [
{
"name": "Kill the rogue cultivator",
"reward": random(270, 350),
"description": "Find and eliminate a dangerous rogue cultivator plaguing the region.",
"gainFame": random(1, 10),
"missionCordX": random(0, 11),
"missionCordY": random(2, 13),
"status": "available",
"region": "Region1",
"id": "killRogueCultivator01",
"baseDangerLevel": 3,
"dangerVariation": 1,
"isCombat": true,
"actualDangerLevel": null,
"estimatedPower": null,
"estimatedRealm": null,
"estimatedStage": null
},
{
"name": "Find the herb",
"reward": random(200, 300),
"description": "Retrieve the rare Crimson Moonflower herb from the location—dangerous only if encountered by beasts.",
"gainFame": random(1, 5),
"missionCordX": random(0, 11),
"missionCordY": random(2, 13),
"status": "available",
"region": "Region1",
"id": "findHerb01",
"baseDangerLevel": 1,
"dangerVariation": 1,
"isCombat": false,
"actualDangerLevel": null,
"estimatedPower": null,
"estimatedRealm": null,
"estimatedStage": null
},
{
"name": "Recover lost scroll",
"reward": random(180, 250),
"description": "A disciple lost an important cultivation scroll near the river bend. Retrieve it before the elements destroy it.",
"gainFame": random(1, 4),
"missionCordX": random(0, 11),
"missionCordY": random(2, 13),
"status": "available",
"region": "Region1",
"id": "recoverScroll01",
"baseDangerLevel": 1,
"dangerVariation": 0,
"isCombat": false,
"actualDangerLevel": null,
"estimatedPower": null,
"estimatedRealm": null,
"estimatedStage": null
},
{
"name": "Slay the demonic beast",
"reward": random(350, 450),
"description": "A powerful demonic beast has emerged near the old shrine. Eliminate it before it spreads chaos and corrupts the land.",
"gainFame": random(5, 10),
"missionCordX": random(0, 11),
"missionCordY": random(2, 13),
"status": "available",
"region": "Region1",
"id": "slayDemonicBeast01",
"baseDangerLevel": 4,
"dangerVariation": 1,
"isCombat": true,
"actualDangerLevel": null,
"estimatedPower": null,
"estimatedRealm": null,
"estimatedStage": null
},
{
"name": "Hunt the river serpent",
"reward": random(350, 500),
"description": "A colossal serpent with scales like jade is terrorizing riverside villages. Slay it and end the terror.",
"gainFame": random(4, 10),
"missionCordX": random(0, 11),
"missionCordY": random(2, 13),
"status": "available",
"region": "Region1",
"id": "huntRiverSerpent01",
"baseDangerLevel": 4,
"dangerVariation": 2,
"isCombat": true,
"actualDangerLevel": null,
"estimatedPower": null,
"estimatedRealm": null,
"estimatedStage": null
},
{
"name": "Rescue the missing disciple",
"reward": random(280, 360),
"description": "A disciple has vanished. Find them and return them safely to the sect.",
"gainFame": random(2, 8),
"missionCordX": random(0, 11),
"missionCordY": random(2, 13),
"status": "available",
"region": "Region1",
"id": "rescueMissingDisciple01",
"baseDangerLevel": 3,
"dangerVariation": 1,
"isCombat": "unknown",
"actualDangerLevel": null,
"estimatedPower": null,
"estimatedRealm": null,
"estimatedStage": null
},
{
"name": "Collect venom sacs",
"reward": random(220, 300),
"description": "Harvest venom sacs from the poison scorpions in the Blighted Wastes for an alchemist's next batch of medicines.",
"gainFame": random(1, 5),
"missionCordX": random(0, 11),
"missionCordY": random(2, 13),
"status": "available",
"region": "Region1",
"id": "collectVenomSacs01",
"baseDangerLevel": 2,
"dangerVariation": 1,
"isCombat": false,
"actualDangerLevel": null,
"estimatedPower": null,
"estimatedRealm": null,
"estimatedStage": null
}
]>>
<!--------------------------------------SECT SIDE MISSIONS-------------------------------->
<<set $SectSideMissions = [
{
"name": "Clean the Sect Courtyard",
"reward": random(3, 6),
"favor": 1,
"description": "Sweep the training ground and remove leftover debris after a sparring session.",
"gainFame": random(0, 2),
"missionCordX": random(0, 11),
"missionCordY": random(2, 13),
"status": "available",
"region": "Region1",
"requiredRank": "Initiate",
"id": "cleanCourtyard01",
"baseDangerLevel": 0,
"dangerVariation": 0,
"isCombat": false,
"actualDangerLevel": 0,
"estimatedPower": null,
"estimatedRealm": null,
"estimatedStage": null
},
{
"name": "Deliver Supplies to Outer Disciples",
"reward": random(4, 7),
"favor": 1,
"description": "Carry medicine and spirit water to the outer disciple quarters.",
"gainFame": random(1, 3),
"missionCordX": random(0, 11),
"missionCordY": random(2, 13),
"status": "available",
"region": "Region1",
"requiredRank": "Initiate",
"id": "deliverSupplies01",
"baseDangerLevel": 0,
"dangerVariation": 0,
"isCombat": false,
"actualDangerLevel": 0,
"estimatedPower": null,
"estimatedRealm": null,
"estimatedStage": null
},
{
"name": "Assist the Alchemy Hall",
"reward": random(5, 9),
"favor": 3,
"description": "Help sort herbs and clean the cauldrons for the alchemists working on breakthrough pills.",
"gainFame": random(1, 4),
"missionCordX": random(0, 11),
"missionCordY": random(2, 13),
"status": "available",
"region": "Region1",
"requiredRank": "Initiate",
"id": "assistAlchemy01",
"baseDangerLevel": 0,
"dangerVariation": 0,
"isCombat": false,
"actualDangerLevel": 0,
"estimatedPower": null,
"estimatedRealm": null,
"estimatedStage": null
},
{
"name": "Patrol the Sect Perimeter",
"reward": random(6, 10),
"favor": 6,
"description": "Join a patrol squad to monitor the perimeter for intruders or demonic beasts.",
"gainFame": random(2, 5),
"missionCordX": random(0, 11),
"missionCordY": random(2, 13),
"status": "available",
"region": "Region1",
"requiredRank": "Disciple",
"id": "patrolPerimeter01",
"baseDangerLevel": 2,
"dangerVariation": 1,
"isCombat": false,
"actualDangerLevel": null,
"estimatedPower": null,
"estimatedRealm": null,
"estimatedStage": null
},
{
"name": "Sparring Partner for Junior Disciples",
"reward": random(4, 8),
"favor": 3,
"description": "Help younger disciples improve by acting as their sparring partner in basic techniques.",
"gainFame": random(1, 4),
"missionCordX": random(0, 11),
"missionCordY": random(2, 13),
"status": "available",
"region": "Region1",
"requiredRank": "Disciple",
"id": "sparringPartner01",
"baseDangerLevel": 1,
"dangerVariation": 0,
"isCombat": false,
"actualDangerLevel": 1,
"estimatedPower": null,
"estimatedRealm": null,
"estimatedStage": null
},
{
"name": "Tend to the Spirit Beast Pens",
"reward": random(5, 9),
"favor": 2,
"description": "Feed the Elder's Spirit Cranes and clean their enclosures. Beware—one may be temperamental.",
"gainFame": random(0, 2),
"missionCordX": random(0, 11),
"missionCordY": random(2, 13),
"status": "available",
"region": "Region1",
"requiredRank": "Initiate",
"id": "tendBeasts01",
"baseDangerLevel": 1,
"dangerVariation": 1,
"isCombat": false,
"actualDangerLevel": null,
"estimatedPower": null,
"estimatedRealm": null,
"estimatedStage": null,
"twistEvent": "beastHeat"
},
{
"name": "Organize the Scripture Pavilion",
"reward": random(6, 10),
"favor": 4,
"description": "Sort returned jade slips and dust the ancient bamboo scrolls in the pavilion archives.",
"gainFame": random(1, 3),
"missionCordX": random(0, 11),
"missionCordY": random(2, 13),
"status": "available",
"region": "Region1",
"requiredRank": "Initiate",
"id": "scripturePavilion01",
"baseDangerLevel": 0,
"dangerVariation": 0,
"isCombat": false,
"actualDangerLevel": 0,
"estimatedPower": null,
"estimatedRealm": null,
"estimatedStage": null
},
{
"name": "Investigate Dormitory Disturbance",
"reward": random(8, 12),
"favor": 6,
"description": "An Elder has complained of strange noises from the Outer Disciple dorms at night. Investigate and report findings.",
"gainFame": random(3, 6),
"missionCordX": random(0, 11),
"missionCordY": random(2, 13),
"status": "available",
"region": "Region1",
"requiredRank": "Disciple",
"id": "dormDisturbance01",
"baseDangerLevel": 2,
"dangerVariation": 1,
"isCombat": false,
"actualDangerLevel": null,
"estimatedPower": null,
"estimatedRealm": null,
"estimatedStage": null,
"twistEvent": "secretLovers"
}
]>><!-- ═════════════════════════════════════════════════════════════
TOURNAMENT HOST & FORMAT RANDOMIZER
Xianxia setting with random rumors & formats
═════════════════════════════════════════════════════════════ -->
<<widget "generateTournamentHost">>
/*
Creates a random tournament host with:
- Random name
- Random title/position
- Random personality/alignment
- Random rumors based on HOST, not player
*/
<<set _hostRealm = ["Body Tempering Realm", "Meridian Awakening Realm", "Qi Condensation Realm", "Foundation Establishment Realm", "Core Formation Realm"].random()>>
<<set _hostStage = ["Early", "Middle", "Late"].random()>>
<!-- Host backgrounds -->
<<set _hostType = ["City Lord", "Sect Elder", "Wandering Cultivator", "Noble Family Head", "Retired Immortal"].random()>>
<!-- Random host names (male/female) -->
<<set _isMaleHost = [true, false].random()>>
<<if _isMaleHost>>
<<set _hostFirstName = ["Lin", "Zhou", "Wang", "Zhang", "Li", "Huang", "Chen", "Wu", "Duan", "Shen"].random()>>
<<set _hostSurname = ["Feng", "Yang", "Jun", "Yuan", "Ming", "Hao", "Tao", "Qi"].random()>>
<<else>>
<<set _hostFirstName = ["Yue", "Xue", "Mei", "Qing", "Ling", "Hua", "Fang", "Lan"].random()>>
<<set _hostSurname = ["Yu", "Luo", "Shen", "Ye", "Xiao", "Su", "Ning", "Mo"].random()>>
<</if>>
<<set _hostFullName to _hostSurname + " " + _hostFirstName>>
<!-- Host personality (affects rumors) -->
<<set _hostAlignment = ["Righteous", "Neutral", "Demonic", "Hedonistic", "Scholarly", "Prideful"].random()>>
<!-- Tournament format -->
<<set _tournamentFormat = [
"Martial Elimination",
"Arena Survival",
"Heavenly Stair Challenge",
"Pill Refining Contest",
"Team Tournament"
].random()>>
<!-- Generate rumors BASED ON HOST ALIGNMENT, not player corruption -->
<<set _rumor to "">>
<<switch _hostAlignment>>
<<case "Righteous">>
<<set _rumor = "They say he seeks only the most virtuous cultivators and rewards merit fairly.">>
<<case "Demonic">>
<<set _rumor = "Whispers suggest he bets heavily on the outcomes. Winners who catch his attention disappear for weeks.">>
<<case "Hedonistic">>
<<if _isMaleHost>>
<<set _rumor = "Rumor has it the lord invites attractive female winners to 'celebrate' the victory privately.">>
<<else>>
<<set _rumor = "Rumor has it the lady invites charming male winners to 'celebrate' the victory privately.">>
<</if>>
<<case "Scholarly">>
<<set _rumor = "He's obsessed with studying cultivation techniques. Winners are questioned extensively about their methods.">>
<<case "Prideful">>
<<set _rumor = "They say he only respects those who can challenge his pride. Winning too easily results in public humiliation.">>
<<case "Neutral">>
<<set _rumor = "Nobody quite knows what he wants. Some say he runs tournaments just to observe cultivators.">>
<</switch>>
<!-- Store in object -->
<<set $tournamentHost = {
name: _hostFullName,
title: _hostType,
realm: _hostRealm,
stage: _hostStage,
alignment: _hostAlignment,
isMale: _isMaleHost,
rumor: _rumor,
format: _tournamentFormat,
prize: random(500, 1500),
location: ["City Grand Arena","Dragon Coliseum","Golden Phoenix Pavilion","Nine Heavens Arena",].random()
}>>
<</widget>>
<!-- ═════════════════════════════════════════════════════════════
TOURNAMENT LOCATION DESCRIPTIONS
═════════════════════════════════════════════════════════════ -->
<<widget "getTournamentLocationDescription">>
/* $args[0]: location name */
<<set _location to $args[0]>>
<<switch _location>>
<<case "City Grand Arena">>
<p>
The largest structure within the city walls. Tens of thousands of spectators fill the stone stands while merchants, nobles, and cultivators compete for the best viewing spots. Massive formations protect the audience from stray techniques.
</p>
<<case "Dragon Coliseum">>
<p>
A colossal arena commissioned centuries ago by a powerful cultivator. Carved dragon statues watch over the battlefield while formation arrays reinforce every inch of the combat grounds.
</p>
<<case "Dragon Coliseum">>
<p>A massive circular structure shaped like a dragon coiled around the fighting pit. Statues of legendary beasts line the walls, and the ground bears scorch marks from centuries of intense battles.</p>
<<case "Golden Phoenix Pavilion">>
<p>
Built by wealthy merchant clans, this magnificent arena combines luxury with martial tradition. Private viewing platforms surround the battlefield, occupied by influential sect elders and city officials.
</p>
<<case "Nine Heavens Arena">>
<p>
Floating platforms hover above the central arena through powerful formations. Contestants often battle both opponents and the unstable terrain itself.
</p>
<</switch>>
<</widget>>
<!-- ═════════════════════════════════════════════════════════════
TOURNAMENT FORMAT DESCRIPTIONS
═════════════════════════════════════════════════════════════ -->
<<widget "getTournamentFormatDescription">>
/* $args[0]: format name */
<<set _format to $args[0]>>
<<switch _format>>
<<case "Martial Elimination">>
<p>
<strong>Martial Elimination:</strong>
The traditional tournament format. Lose once and your journey ends. Each victory advances you toward the championship and greater rewards.
</p>
<<case "Arena Survival">>
<p>
<strong>Arena Survival:</strong>
Dozens of cultivators enter the arena simultaneously. Alliances form and shatter in moments. Survive until only a handful remain.
</p>
<<case "King of the Hill">>
<p>
<strong>King of the Hill:</strong>
A spirit platform appears at the center of the arena. Contestants earn points by controlling it while fending off challengers from every direction.
</p>
<<case "Heavenly Stair Challenge">>
<p>
<strong>Heavenly Stair Challenge:</strong>
An ancient formation manifests a staircase reaching toward the heavens. Each step places greater pressure upon the body, mind, and soul.
</p>
<<case "Pill Refining Contest">>
<p>
<strong>Pill Refining Contest:</strong>
Contestants race against time to refine the highest-quality pill possible. Precision and control are valued more than combat strength.
</p>
<<case "Team Tournament">>
<p>
<strong>Team Tournament:</strong>
Cultivators fight in small groups. Strategy, teamwork, and coordination often overcome individual strength.
</p>
<</switch>>
<</widget>>
<<widget "initializeTournamentFormat">>
<<set _format to $args[0] ?? $tournamentHost.format>>
<<switch _format>>
<<case "Martial Elimination">>
<<set $tournamentData = {
format: _format,
round: 1,
wins: 0,
losses: 0,
opponentsRemaining: 31
}>>
<<case "Arena Survival">>
<<set $tournamentData = {
format: _format,
turn: 1,
survivors: 64,
points: 0,
kills: 0
}>>
<<case "Heavenly Stair Challenge">>
<<set $tournamentData = {
format: _format,
currentStep: 1,
highestStep: 1,
pressure: 0
}>>
<<case "Pill Refining Contest">>
<<set $tournamentData = {
format: _format,
timeRemaining: 20,
purity: 0,
stability: 0,
quality: 0
}>>
<<case "Team Tournament">>
<<set $tournamentData = {
format: _format,
round: 1,
wins: 0,
losses: 0,
allies: [],
allyHealth: []
}>>
<</switch>>
<</widget>>
<!-- ═════════════════════════════════════════════════════════════
DIFFICULTY SCALING - Based on User's Index System
═════════════════════════════════════════════════════════════ -->
<<widget "applyDifficultyScaling">>
/*
$args[0]: Tournament round (1=Prelim, 2=Top16, 3=Top8, 4=Finals, 5=Championship)
Sets _targetRealm and _targetStage for CreateNPC001
*/
<<set _tournamentRound to $args[0] ?? 1>>
/* Get Player Indices */
<<set _pRealmIdx to $cultivationRealms.indexOf($cultivationRealm)>>
<<set _pStageIdx to $cultivationStages.indexOf($cultivationStage)>>
<<if _pRealmIdx < 0>><<set _pRealmIdx = 0>><</if>>
<<if _pStageIdx < 0>><<set _pStageIdx = 0>><</if>>
<<set _maxRealmIdx = $cultivationRealms.length - 1>>
/* Rolls */
<<set _rollRealm to random(1, 100)>>
<<set _rollStage to random(1, 100)>>
<<set _finalRoll to random(1, 100)>>
/* Default shifts */
<<set _realmShift = 0>>
<<set _stageShift = 0>>
/* ROUND LOGIC */
<<if _tournamentRound is 1>>
/* PRELIMINARY */
<<set _realmShift = -1>>
<<set _stageShift = -1>>
<<elseif _tournamentRound is 2>>
/* TOP 16 */
<<if _rollRealm lte 60>>
<<set _realmShift = 0>>
<<elseif _rollRealm lte 85>>
<<set _realmShift = -1>>
<<else>>
<<set _realmShift = 1>>
<</if>>
<<if _rollStage lte 50>>
<<set _stageShift = 0>>
<<elseif _rollStage lte 80>>
<<set _stageShift = -1>>
<<else>>
<<set _stageShift = 1>>
<</if>>
<<elseif _tournamentRound is 3>>
/* TOP 8 */
<<if _rollRealm lte 70>>
<<set _realmShift = 0>>
<<else>>
<<set _realmShift = 1>>
<</if>>
<<if _rollStage lte 50>>
<<set _stageShift = 1>>
<<else>>
<<set _stageShift = 0>>
<</if>>
<<elseif _tournamentRound is 4>>
/* FINALS */
<<set _realmShift = 0>>
<<set _stageShift = 1>>
<<elseif _tournamentRound is 5>>
/* CHAMPIONSHIP */
<<set _isLateStage to _pStageIdx === 2>>
<<set _canAdvanceRealm to _pRealmIdx < _maxRealmIdx>>
<<if _isLateStage and _canAdvanceRealm and _finalRoll lte 50>>
<<set _realmShift = 1>>
<<set _stageShift = 0>>
<<else>>
<<set _realmShift = 0>>
<<set _stageShift = 1>>
<</if>>
<</if>>
/* APPLY CLAMP */
<<set _enemyRealmIdx = Math.max(0, Math.min(_maxRealmIdx, _pRealmIdx + _realmShift))>>
<<set _enemyStageIdx = Math.max(0, Math.min(2, _pStageIdx + _stageShift))>>
/* SAFETY FALLBACK */
<<if _enemyRealmIdx < 0 or _enemyRealmIdx > _maxRealmIdx>>
<<set _enemyRealmIdx = _pRealmIdx>>
<</if>>
<<if _enemyStageIdx < 0 or _enemyStageIdx > 2>>
<<set _enemyStageIdx = _pStageIdx>>
<</if>>
/* SET TARGET FOR CREATENPC001 */
<<set _targetRealm to $cultivationRealms[_enemyRealmIdx]>>
<<set _targetStage to $cultivationStages[_enemyStageIdx]>>
<</widget>>
<!-- ═════════════════════════════════════════════════════════════
SINGLE ELIMINATION OPPONENT GENERATION
═════════════════════════════════════════════════════════════ -->
<<widget "generateSingleEliminationOpponent">>
<<applyDifficultyScaling $tournamentData.round>>
<<CreateNPC001>>
<</widget>><!-- ═════════════════════════════════════════════════════════════
MARTIAL ELIMINATION - VICTORY & DEFEAT OUTCOMES
Based on host alignment and tournament stage
═════════════════════════════════════════════════════════════ -->
<<widget "getMartialEliminationVictory">>
/*
Champion victory for Martial Elimination
Varies based on $tournamentHost.alignment
*/
<<set _hostName to $tournamentHost.name>>
<<set _hostTitle to $tournamentHost.title>>
<<set _hostAlign to $tournamentHost.alignment>>
<div class="tournament-victory">
<h2>⚔️ CHAMPIONSHIP VICTORY!</h2>
<<switch _hostAlign>>
<<case "Righteous">>
<p>The final opponent falls before your overwhelming technique. The crowd erupts in cheers as you stand victorious.</p>
<p><<print _hostName>> approaches, a look of genuine respect in their eyes.</p>
<p><span class="male">"You have proven yourself worthy through skill, courage, and honor. This victory is yours by right."</span></p>
<p>The crowd bows. <<print _hostName>> places the championship insignia around your neck personally.</p>
<p><span class="male">"Go forth. The Jianghu will hear of your name. Perhaps one day you will surpass even me."</span></p>
<<set $fame += 50>>
<<set $combatFame += 50>>
<<set $gold += 1000>>
<<case "Demonic">>
<p>Your final opponent crumples to the ground, barely conscious. You are the last one standing.</p>
<p><<print _hostName>> appears at the arena edge, eyes gleaming with dark appreciation.</p>
<p><span class="male">"Exquisite brutality. You have the instincts of a true killer. Few possess such... potential."</span></p>
<p>The host's smile is unsettling. <span class="male">"Tell me, champion — have you ever considered working for someone? The kind of power you possess could be... leveraged."</span></p>
<p>A heavy purse is tossed at your feet, along with a jade token bearing a dark insignia.</p>
<p><span class="male">"When you tire of righteousness, find me. We could do terrible things together."</span></p>
<<set $fame += 40>>
<<set $combatFame += 50>>
<<set $gold += 800>>
<<set $sectSuspicion += 5>>
<<case "Hedonistic">>
<p>Your opponent surrenders rather than face another blow. Victory is yours.</p>
<p><<print _hostName>> descends into the arena with several attendants, face flushed with excitement.</p>
<p><span class="male">"What a magnificent display! Your power, your grace, your... presence. Absolutely intoxicating."</span></p>
<p>The host circles you, appraising. <span class="male">"A champion must celebrate properly. I insist you join my private gathering tonight. The finest wines, the finest company... and perhaps something more?"</span></p>
<p>Before you can respond, the host snaps their fingers. Servants arrive with luxurious robes and a personal invitation.</p>
<p><span class="male">"Come. Let us discuss your... future endeavors."</span></p>
<<set $fame += 35>>
<<set $combatFame += 50>>
<<set $gold += 900>>
<<set $corruption += 5>>
<<case "Scholarly">>
<p>The final match concludes with a breathtaking display of technique. Your opponent acknowledges defeat with respect.</p>
<p><<print _hostName>> practically sprints to the arena, eyes wide with intellectual fervor.</p>
<p><span class="male">"EXTRAORDINARY! Your cultivation method — the flow of energy, the technique sequencing — I detected seven distinct styles interwoven! How did you synthesize such incompatible approaches?"</span></p>
<p>The host begins furiously taking notes, barely pausing for breath.</p>
<p><span class="male">"You must allow me to document your techniques. For scholarship, you understand. I'll pay handsomely for detailed explanations of your abilities."</span></p>
<p>Several scrolls and a heavy coin purse are thrust toward you.</p>
<<set $fame += 45>>
<<set $combatFame += 50>>
<<set $gold += 950>>
<<case "Prideful">>
<p>You demolish your final opponent, proving beyond doubt your superiority.</p>
<p><<print _hostName>> stands slowly, expression unreadable. The arena falls silent.</p>
<p><span class="male">"I see. So you are the stronger cultivator."</span> The host's voice is cold, calculating.</p>
<p><span class="male">"Few have ever forced me to acknowledge such a thing. It is... humbling."</span> A pause, heavy with meaning.</p>
<p><span class="male">"Guard that victory well. There are those who will resent your success. And know this — should we ever meet in true combat, I will not hold back."</span></p>
<p>The champion prize is presented without ceremony. <<print _hostName>> watches with eyes that promise future challenges.</p>
<<set $fame += 60>>
<<set $combatFame += 60>>
<<set $gold += 750>>
<<case "Neutral">>
<p>Your final opponent falls. You are the champion.</p>
<p><<print _hostName>> observes from their seat, expression neutral.</p>
<p><span class="male">"You have proven stronger than your peers. The tournament concludes."</span></p>
<p>The host stands, offering a respectful bow — neither warm nor cold.</p>
<p><span class="male">"Perhaps we shall meet again. Until then, carry this victory with humility."</span></p>
<p>The champion's prize is delivered formally. <<print _hostName>> watches as you depart, expression still unreadable.</p>
<<set $fame += 40>>
<<set $combatFame += 50>>
<<set $gold += 800>>
<</switch>>
</div>
<</widget>>
<<widget "getMartialEliminationDefeat">>
/*
$args[0]: Stage defeated at (1=Prelim, 2=Top16, 3=Top8, 4=Top4, 5=Championship)
Defeat text for Martial Elimination
*/
<<set _stageDefeated to $args[0] ?? 1>>
<<set _hostName to $tournamentHost.name>>
<<set _hostAlign to $tournamentHost.alignment>>
<div class="tournament-defeat">
<<if _stageDefeated is 1>>
<!-- PRELIMINARY DEFEAT -->
<p>Your opponent's technique overwhelms you. You fall to your knees, unable to continue.</p>
<p>The crowd watches indifferently as you're helped from the arena. Many stronger cultivators remain.</p>
<<switch _hostAlign>>
<<case "Righteous">>
<p><span class="male">"You fought with honor. Better luck next time. The tournament is unforgiving."</span></p>
<<case "Demonic">>
<p><<print _hostName>> doesn't even glance your way. You're dismissed immediately, forgotten.</p>
<<case "Hedonistic">>
<p><<print _hostName>> looks momentarily disappointed. <span class="male">"A shame. You were... promising."</span></p>
<<case "Scholarly">>
<p><<print _hostName>> makes brief notes. <span class="male">"Interesting technique, but insufficient control."</span></p>
<<case "Prideful">>
<p><<print _hostName>> shows no reaction. You're beneath notice.</p>
<<case "Neutral">>
<p><<print _hostName>> nods neutrally. <span class="male">"The strong advance."</span></p>
<</switch>>
<<set $combatFame += 1>>
<<set $fame += 1>>
<<set $gold += 25>>
<<elseif _stageDefeated is 2>>
<!-- ROUND OF 16 DEFEAT -->
<p>You fought valiantly, but your opponent proves too skilled. After a grueling battle, you're forced to yield.</p>
<p>As you leave the arena, the crowd shows respect — you've earned your place among the best sixteen.</p>
<<switch _hostAlign>>
<<case "Righteous">>
<p><<print _hostName>> nods approvingly as you depart. <span class="male">"You fought with honor. Return stronger."</span></p>
<<case "Demonic">>
<p><<print _hostName>> leans forward, studying you with renewed interest. <span class="male">"Hmm. Stronger than expected."</span></p>
<<case "Hedonistic">>
<p><<print _hostName>> offers encouragement. <span class="male">"You've come far. Perhaps next time, we celebrate your victory."</span></p>
<<case "Scholarly">>
<p><<print _hostName>> approaches with questions. <span class="male">"That technique in round three — where did you learn it?"</span></p>
<<case "Prideful">>
<p><<print _hostName>> barely acknowledges you. You're closer to their level, but still not quite there.</p>
<<case "Neutral">>
<p><<print _hostName>> observes neutrally. <span class="male">"You have progressed."</span></p>
<</switch>>
<<set $combatFame += 5>>
<<set $fame += 5>>
<<set $gold += 100>>
<<elseif _stageDefeated is 3>>
<!-- TOP 8 DEFEAT -->
<p>You've reached the elite eight, but your opponent's power overwhelms you. A final, devastating strike ends the match.</p>
<p>The crowd rises in respect. You've proven yourself among the strongest cultivators here.</p>
<<switch _hostAlign>>
<<case "Righteous">>
<p><<print _hostName>> stands and bows slightly to you. <span class="male">"You have shown great strength and character. Well fought."</span></p>
<<case "Demonic">>
<p><<print _hostName>> watches with intense interest. <span class="male">"Now THIS shows promise. I may remember you."</span></p>
<<case "Hedonistic">>
<p><<print _hostName>> looks genuinely impressed. <span class="male">"Making it this far is no small feat. You deserve celebration."</span></p>
<<case "Scholarly">>
<p><<print _hostName>> examines you as if you were an fascinating specimen. <span class="male">"The techniques you demonstrated... remarkable synthesis."</span></p>
<<case "Prideful">>
<p><<print _hostName>> nods with respect — a rare honor. <span class="male">"You have strength. Not enough... but strength nonetheless."</span></p>
<<case "Neutral">>
<p><<print _hostName>> stands. <span class="male">"You have proven yourself among the elite. That is worthy."</span></p>
<</switch>>
<<set $combatFame += 15>>
<<set $fame += 15>>
<<set $gold += 250>>
<<elseif _stageDefeated is 4>>
<!-- TOP 4 / SEMIFINALS DEFEAT -->
<p>You fight with everything you have, pushing yourself to the absolute limit. But your opponent is simply superior.</p>
<p>As you fall, the crowd erupts — you've reached the final four, a monumental achievement.</p>
<p>Only three cultivators remain in contention. You are one of the four strongest here.</p>
<<switch _hostAlign>>
<<case "Righteous">>
<p><<print _hostName>> personally helps you to your feet. <span class="male">"You have fought magnificently. Few reach this stage. Your name will be remembered."</span></p>
<<case "Demonic">>
<p><<print _hostName>> approaches, eyes gleaming with dark appreciation. <span class="male">"Few possess your caliber. I will not forget you."</span></p>
<<case "Hedonistic">>
<p><<print _hostName>> looks at you with genuine admiration. <span class="male">"Reaching the final four... you are exceptional. Come, let me reward your efforts properly."</span></p>
<<case "Scholarly">>
<p><<print _hostName>> bombards you with questions about your techniques even as you catch your breath.</p>
<<case "Prideful">>
<p><<print _hostName>> stands and applauds slowly. <span class="male">"You have earned my respect. Few do."</span></p>
<<case "Neutral">>
<p><<print _hostName>> stands and bows deeply to you. <span class="male">"To reach the final four is to achieve what most can only dream of."</span></p>
<</switch>>
<<set $combatFame += 25>>
<<set $fame += 25>>
<<set $gold += 400>>
<<elseif _stageDefeated is 5>>
<!-- CHAMPIONSHIP MATCH DEFEAT -->
<p>You give everything you have. For a moment, you think you might actually win.</p>
<p>But your opponent is simply too strong. A final, overwhelming technique ends the match.</p>
<p>You are the runner-up. Second only to the greatest cultivator in this tournament.</p>
<p>The crowd is on their feet. You've reached the championship — perhaps the greatest achievement of your life.</p>
<<switch _hostAlign>>
<<case "Righteous">>
<p><<print _hostName>> helps you up personally, genuine warmth in their expression.</p>
<p><span class="male">"You have fought with unparalleled honor. This loss diminishes you not. You are a true champion of the spirit."</span></p>
<p>The host places a laurel crown upon your head. <span class="male">"Go forward knowing you have reached heights few ever touch."</span></p>
<<case "Demonic">>
<p><<print _hostName>> studies you with intense interest.</p>
<p><span class="male">"You came so close to absolute power. That hunger in your eyes... I see great potential. Come — let us discuss your future."</span></p>
<p>A dark gaze holds you. <span class="male">"A second-place finish is not the end. It is merely the beginning."</span></p>
<<case "Hedonistic">>
<p><<print _hostName>> approaches with admiration and something else — pity, perhaps, or desire.</p>
<p><span class="male">"Oh, what a magnificent battle! You came so close, and fought with such passion. You must let me reward you properly for your efforts."</span></p>
<p>The host's hand lingers on your shoulder. <span class="male">"Come to my private chambers. We shall celebrate together... thoroughly."</span></p>
<<set $corruption += 10>>
<<case "Scholarly">>
<p><<print _hostName>> practically trembles with excitement.</p>
<p><span class="male">"The techniques you displayed! The innovation! I must document everything! Please, let's discuss your cultivation path in detail."</span></p>
<p>A substantial payment is offered. <span class="male">"Name your price for exclusive access to your knowledge."</span></p>
<<case "Prideful">>
<p><<print _hostName>> rises slowly, offering you the deepest respect.</p>
<p><span class="male">"You have challenged me — challenged MY tournament, MY authority. Few dare such things."</span></p>
<p><span class="male">"You lost, yes. But you reached the pinnacle. That alone warrants acknowledgment."</span></p>
<p>A formal bow. <span class="male">"Perhaps next time, you will claim the throne."</span></p>
<<case "Neutral">>
<p><<print _hostName>> stands and offers a respectful bow.</p>
<p><span class="male">"Second place in a championship of this caliber is a remarkable achievement. Few will ever reach where you have reached."</span></p>
<p><span class="male">"You may not leave here as champion, but you leave as legend."</span></p>
<</switch>>
<<set $combatFame += 40>>
<<set $fame += 40>>
<<set $gold += 600>>
<</if>>
</div>
<</widget>>
<!-- ═════════════════════════════════════════════════════════════
ARENA SURVIVAL - VICTORY & DEFEAT OUTCOMES
═════════════════════════════════════════════════════════════ -->
<<widget "getArenaSurvivalVictory">>
<<set _hostName to $tournamentHost.name>>
<<set _hostAlign to $tournamentHost.alignment>>
<<set _kills to $arenaSurvivalKills ?? 0>>
<<set _health to $arenaSurvivalHealth ?? 0>>
<<set _energy to $arenaSurvivalEnergy ?? 0>>
<<set _totalEnemies to $arenaSurvivalTotalEnemies ?? 12>>
<div class="tournament-victory">
<h2>🏆 LAST ONE STANDING!</h2>
<p>Bodies litter the arena floor. Of the <<print _totalEnemies>> cultivators who entered, you alone remain.</p>
<p>You personally eliminated <strong><<print _kills>></strong> opponents.</p>
<<if $equippedRobe && $equippedRobe.durability < 20>>
<p>Your robe hangs in tatters, barely clinging to your battered frame – a badge of your brutal survival.</p>
<<elseif $equippedRobe && $equippedRobe.durability < 50>>
<p>Your robe is torn and bloodied, but still serviceable.</p>
<</if>>
<p>You stand with <strong><<print _health>></strong> health and <strong><<print _energy>></strong> energy remaining.</p>
<p>The crowd erupts in a frenzy of cheers and screams. You are the sole survivor.</p>
<<switch _hostAlign>>
<<case "Righteous">>
<p><<print _hostName>> approaches, impressed by your survival instinct.</p>
<p><span class="male">"To survive is its own form of strength. You are the last warrior standing. Well earned."</span></p>
<<case "Demonic">>
<p><<print _hostName>> grins widely, delighted by the carnage you've orchestrated.</p>
<p><span class="male">"The brutality... the cunning... YES. This is what the Jianghu is truly about."</span></p>
<<case "Hedonistic">>
<p><<print _hostName>> watches you with raw appreciation, blood-spattered and victorious.</p>
<p><span class="male">"The primal energy... your strength, your intensity. Magnificent."</span></p>
<<case "Scholarly">>
<p><<print _hostName>> examines the arena carefully, taking notes on the positioning of bodies.</p>
<p><span class="male">"Fascinating. Your tactical decisions... you eliminated threats in optimal sequence."</span></p>
<<case "Prideful">>
<p><<print _hostName>> nods with respect, recognizing superior cunning and strength.</p>
<p><span class="male">"Survival requires more than power. You possessed strategy. Intelligence. I respect that."</span></p>
<<case "Neutral">>
<p><<print _hostName>> observes dispassionately.</p>
<p><span class="male">"You survived. That was the objective. The objective is achieved."</span></p>
<</switch>>
<<set $fame += 55>>
<<set $combatFame += 55>>
<<set $gold += 1100>>
</div>
<</widget>>
<<widget "getArenaSurvivalDefeat">>
<<set _hostName to $tournamentHost.name>>
<<set _hostAlign to $tournamentHost.alignment>>
<<set _kills to $arenaSurvivalKills ?? 0>>
<<set _health to $arenaSurvivalHealth ?? 0>>
<<set _energy to $arenaSurvivalEnergy ?? 0>>
<<set _remaining to $arenaSurvivalRemainingEnemies ?? 12>>
<<set _totalEnemies to $arenaSurvivalTotalEnemies ?? 12>>
/* Determine stage based on enemies left */
<<if _remaining >= 10>>
<<set _stage to 1>> <!-- Early elimination -->
<<elseif _remaining >= 6>>
<<set _stage to 2>> <!-- Mid-stage -->
<<elseif _remaining >= 3>>
<<set _stage to 3>> <!-- Final five (approx) -->
<<else>>
<<set _stage to 4>> <!-- Final three or less -->
<</if>>
<div class="tournament-defeat">
<<if _stage is 1>>
<h2>Arena Survival – Eliminated Early</h2>
<p>The chaos of dozens of cultivators clashing overwhelms you. <<print _remaining>> enemies still stalk the arena when you fall.</p>
<p>You managed to defeat <strong><<print _kills>></strong> before being overwhelmed.</p>
<<switch _hostAlign>>
<<case "Righteous">>
<p><<print _hostName>> shows understanding. <span class="male">"The chaos is not for all. You fought bravely."</span></p>
<<case "Demonic">>
<p><<print _hostName>> doesn't even glance at your elimination. There are plenty more bodies.</p>
<<case "Hedonistic">>
<p><<print _hostName>> sighs with mild disappointment. <span class="male">"A shame. I had high hopes."</span></p>
<<case "Scholarly">>
<p><<print _hostName>> makes notes. <span class="male">"Interesting failure pattern."</span></p>
<<case "Prideful">>
<p><<print _hostName>> shows no reaction.</p>
<<case "Neutral">>
<p><<print _hostName>> simply nods. <span class="male">"You did not endure."</span></p>
<</switch>>
<<set $combatFame += 2>>
<<set $fame += 2>>
<<set $gold += 50>>
<<elseif _stage is 2>>
<h2>Arena Survival – Mid-Stage Elimination</h2>
<p>You survive the initial chaos and eliminate <strong><<print _kills>></strong> opponents, but <<print _remaining>> foes remain and eventually overwhelm you.</p>
<<switch _hostAlign>>
<<case "Righteous">>
<p><<print _hostName>> nods with respect. <span class="male">"You proved yourself among many. That has worth."</span></p>
<<case "Demonic">>
<p><<print _hostName>> studies you with interest. <span class="male">"You lasted longer than most. Not bad."</span></p>
<<case "Hedonistic">>
<p><<print _hostName>> shows genuine approval. <span class="male">"You fought well. Perhaps I'll remember you."</span></p>
<<case "Scholarly">>
<p><<print _hostName>> approaches with questions about your survival tactics.</p>
<<case "Prideful">>
<p><<print _hostName>> acknowledges you with a slight nod.</p>
<<case "Neutral">>
<p><<print _hostName>> observes clinically. <span class="male">"You persisted longer than many."</span></p>
<</switch>>
<<set $combatFame += 8>>
<<set $fame += 8>>
<<set $gold += 150>>
<<elseif _stage is 3>>
<h2>Arena Survival – Top Five Elimination</h2>
<p>You've survived the chaos. Only <strong><<print _remaining>></strong> cultivators remain in the arena when you fall – a feat few achieve.</p>
<p>You took down <strong><<print _kills>></strong> opponents before succumbing.</p>
<<switch _hostAlign>>
<<case "Righteous">>
<p><<print _hostName>> stands and bows to you. <span class="male">"Among the final few. That is exceptional."</span></p>
<<case "Demonic">>
<p><<print _hostName>> leans forward with dark interest. <span class="male">"Almost made it. You're stronger than most."</span></p>
<<case "Hedonistic">>
<p><<print _hostName>> looks at you with clear admiration. <span class="male">"Reaching the final handful... you are remarkable."</span></p>
<<case "Scholarly">>
<p><<print _hostName>> enthusiastically approaches. <span class="male">"Your survival tactics were exceptional!"</span></p>
<<case "Prideful">>
<p><<print _hostName>> nods with clear respect. <span class="male">"Few reach that stage."</span></p>
<<case "Neutral">>
<p><<print _hostName>> stands. <span class="male">"Top five is an achievement worthy of recognition."</span></p>
<</switch>>
<<set $combatFame += 20>>
<<set $fame += 20>>
<<set $gold += 300>>
<<elseif _stage is 4>>
<h2>Arena Survival – Final Fight</h2>
<p>Only <strong><<print _remaining>></strong> enemies remain when you are finally bested. You were so close.</p>
<p>You personally eliminated <strong><<print _kills>></strong> cultivators – a legendary tally.</p>
<<switch _hostAlign>>
<<case "Righteous">>
<p><<print _hostName>> personally helps you up, genuine respect in their gaze.</p>
<p><span class="male">"To reach the very end... you have proven yourself a true warrior."</span></p>
<<case "Demonic">>
<p><<print _hostName>> eyes you with intense interest.</p>
<p><span class="male">"Almost the apex predator. I'll be watching you."</span></p>
<<case "Hedonistic">>
<p><<print _hostName>> approaches with undisguised admiration.</p>
<p><span class="male">"Surviving to the final moments... you are exceptional. Come celebrate with me."</span></p>
<<set $corruption += 8>>
<<case "Scholarly">>
<p><<print _hostName>> practically vibrates with excitement.</p>
<p><span class="male">"The tactical and physical developments evident in your final matches... extraordinary!"</span></p>
<<case "Prideful">>
<p><<print _hostName>> stands and bows deeply to you.</p>
<p><span class="male">"Few possess the strength and cunning to reach where you have reached."</span></p>
<<case "Neutral">>
<p><<print _hostName>> offers a respectful bow.</p>
<p><span class="male">"Final contenders. You are legend."</span></p>
<</switch>>
<<set $combatFame += 38>>
<<set $fame += 38>>
<<set $gold += 550>>
<</if>>
<!-- Robe status mention -->
<<if $equippedRobe && $equippedRobe.durability < 20>>
<p>Your robe is completely shredded – everyone saw more than just your fighting spirit.</p>
<<elseif $equippedRobe && $equippedRobe.durability < 50>>
<p>Your robe bears deep gashes and tears, a reminder of the battle's ferocity.</p>
<</if>>
</div>
<</widget>>
<!-- ═════════════════════════════════════════════════════════════
PILL REFINING CONTEST - VICTORY & DEFEAT OUTCOMES
═════════════════════════════════════════════════════════════ -->
<<widget "getPillRefiningVictory">>
<<set _hostName to $tournamentHost.name>>
<<set _hostAlign to $tournamentHost.alignment>>
<<set _score to $prScore>>
<div class="tournament-victory">
<h2>🔷 SUPREME PILL REFINER!</h2>
<p>The final pills are unveiled. Judges examine each carefully, testing quality, potency, purity.</p>
<p>Your pill stands above all others — a masterwork of alchemy and control. <strong>Quality score: <<print _score>></strong>.</p>
<p>You are declared the supreme pill refiner of this tournament.</p>
<<switch _hostAlign>>
<<case "Righteous">>
<p><<print _hostName>> examines your pill with genuine appreciation.</p>
<p><span class="male">"Such precision. Such purity. This is the work of a true master."</span></p>
<<case "Demonic">>
<p><<print _hostName>> studies your pill with commercial interest.</p>
<p><span class="male">"Excellent quality. Pills like this could be worth significant fortune. Interested in a partnership?"</span></p>
<<case "Hedonistic">>
<p><<print _hostName>> inhales the pill's aroma with obvious pleasure.</p>
<p><span class="male">"Not just functional, but... exquisite. You have both skill and refinement."</span></p>
<<case "Scholarly">>
<p><<print _hostName>> examines your pill under a magnifying lens, taking extensive notes.</p>
<p><span class="male">"The refinement process... the structure... I've never seen such sophistication!"</span></p>
<<case "Prideful">>
<p><<print _hostName>> studies your pill with obvious respect.</p>
<p><span class="male">"Few possess such mastery. You have surpassed your peers."</span></p>
<<case "Neutral">>
<p><<print _hostName>> examines your pill objectively.</p>
<p><span class="male">"Superior quality. Well executed."</span></p>
<</switch>>
<<set $fame += 45>>
<<set $combatFame += 30>>
<<set $gold += $tournamentHost.prize>>
</div>
<</widget>>
<<widget "getPillRefiningDefeat">>
<<set _hostName to $tournamentHost.name>>
<<set _hostAlign to $tournamentHost.alignment>>
<<set _score to $prScore>>
<<set _rank to $prPlayerRank>>
<<set _total to $prTotal>>
<<if _rank is 2>>
<<set _stage to "second">>
<<elseif _rank is 3>>
<<set _stage to "finalThree">>
<<elseif _rank lte Math.ceil(_total / 2)>>
<<set _stage to "mid">>
<<else>>
<<set _stage to "low">>
<</if>>
<div class="tournament-defeat">
<<if _stage eq "second">>
<h2>🥈 Second Place – Nearly Perfect</h2>
<p>Your pill is almost flawless. The judges examine it for a long time, impressed. <strong>Score: <<print _score>></strong>.</p>
<p>It is exceptional – but one other pill surpasses it, if only by a hair.</p>
<<switch _hostAlign>>
<<case "Righteous">>
<p><<print _hostName>> personally congratulates you. <span class="male">"To come so close to perfection is the mark of a master. Second here is a triumph."</span></p>
<<case "Demonic">>
<p><<print _hostName>> eyes your work with keen interest. <span class="male">"Top two. Almost made it. I could use someone of your caliber."</span></p>
<<case "Hedonistic">>
<p><<print _hostName>> admires your pill. <span class="male">"Such exquisite work. Nearly flawless. You deserve celebration for your effort."</span></p>
<<set $corruption += 5>>
<<case "Scholarly">>
<p><<print _hostName>> is ecstatic. <span class="male">"The precision! The technique! Tell me everything about your method!"</span></p>
<<case "Prideful">>
<p><<print _hostName>> offers a formal bow. <span class="male">"Second place here is an achievement only a master could attain."</span></p>
<<case "Neutral">>
<p><<print _hostName>> bows respectfully. <span class="male">"Master-level skill. That is no small achievement."</span></p>
<</switch>>
<<set $fame += 35>>
<<set $combatFame += 35>>
<<set $gold += 550>>
<<elseif _stage eq "finalThree">>
<h2>🌟 Final Three – Exceptional Skill</h2>
<p>Your pill stands among the finest three. <strong>Score: <<print _score>></strong>. The judges clearly recognise your talent.</p>
<<switch _hostAlign>>
<<case "Righteous">>
<p><<print _hostName>> bows slightly. <span class="male">"To rank in the final three shows true mastery."</span></p>
<<case "Demonic">>
<p><<print _hostName>> leans forward with interest. <span class="male">"Top three. That shows real promise."</span></p>
<<case "Hedonistic">>
<p><<print _hostName>> examines your pill with undisguised appreciation. <span class="male">"Magnificent work. Nearly perfect."</span></p>
<<case "Scholarly">>
<p><<print _hostName>> approaches with enthusiasm. <span class="male">"Your refinement technique is nearly flawless!"</span></p>
<<case "Prideful">>
<p><<print _hostName>> nods with respect. <span class="male">"You possess true skill."</span></p>
<<case "Neutral">>
<p><<print _hostName>> stands. <span class="male">"You demonstrated exceptional craftsmanship."</span></p>
<</switch>>
<<set $fame += 20>>
<<set $combatFame += 20>>
<<set $gold += 400>>
<<elseif _stage eq "mid">>
<h2>📿 Mid‑Tier Ranking – Solid Work</h2>
<p>Your pill earns a decent score of <<print _score>>. It’s not top‑tier, but you outperformed many.</p>
<<switch _hostAlign>>
<<case "Righteous">>
<p><<print _hostName>> nods approvingly. <span class="male">"Solid work. You show real potential."</span></p>
<<case "Demonic">>
<p><<print _hostName>> shrugs. <span class="male">"Decent craftsmanship. Keep working."</span></p>
<<case "Hedonistic">>
<p><<print _hostName>> offers a polite smile. <span class="male">"Respectable effort. You have promise."</span></p>
<<case "Scholarly">>
<p><<print _hostName>> makes notes. <span class="male">"Good technique. Room for improvement."</span></p>
<<case "Prideful">>
<p><<print _hostName>> acknowledges you faintly.</p>
<<case "Neutral">>
<p><<print _hostName>> observes. <span class="male">"Adequate craftsmanship."</span></p>
<</switch>>
<<set $fame += 8>>
<<set $combatFame += 8>>
<<set $gold += 250>>
<<else>>
<h2>💥 Lower Rankings – The Cauldron Fails You</h2>
<p>Your pill scores a meagre <<print _score>>. The judges barely glance at it. You finish near the bottom.</p>
<<switch _hostAlign>>
<<case "Righteous">>
<p><<print _hostName>> is encouraging. <span class="male">"Pill refining takes time. Keep practicing."</span></p>
<<case "Demonic">>
<p><<print _hostName>> shows no interest.</p>
<<case "Hedonistic">>
<p><<print _hostName>> offers sympathy. <span class="male">"Better luck next time."</span></p>
<<case "Scholarly">>
<p><<print _hostName>> makes notes on your pill's deficiencies.</p>
<<case "Prideful">>
<p><<print _hostName>> shows no reaction.</p>
<<case "Neutral">>
<p><<print _hostName>> nods. <span class="male">"Your skill was insufficient."</span></p>
<</switch>>
<<set $fame += 2>>
<<set $combatFame += 2>>
<<set $gold += 100>>
<</if>>
<<if _score lte 30 and $equippedRobe>>
<p>The backlash from the failed refinement has scorched your robe, leaving it frayed and embarrassing.</p>
<<set $equippedRobe.durability to Math.max(0, $equippedRobe.durability - 20)>>
<</if>>
</div>
<</widget>>
<!-- ═════════════════════════════════════════════════════════════
TEAM TOURNAMENT - VICTORY & DEFEAT OUTCOMES
═════════════════════════════════════════════════════════════ -->
<<widget "getTeamTournamentVictory">>
<<set _hostName to $tournamentHost.name>>
<<set _hostAlign to $tournamentHost.alignment>>
<div class="tournament-victory">
<h2>🏆 TEAM CHAMPIONS!</h2>
<p>Your team stands victorious on the arena floor. The opposing team lies defeated.</p>
<p>You are not just a strong cultivator — you are a leader. Your team followed you to triumph.</p>
<<switch _hostAlign>>
<<case "Righteous">>
<p><<print _hostName>> approaches and bows to you and your teammates.</p>
<p><span class="male">"Teamwork, honor, and strength. You have shown all three. Well earned."</span></p>
<<case "Demonic">>
<p><<print _hostName>> studies your team with interest.</p>
<p><span class="male">"You've built something powerful. A unified force. Such things are... valuable."</span></p>
<<case "Hedonistic">>
<p><<print _hostName>> watches your team with clear appreciation.</p>
<p><span class="male">"The synergy, the coordination... beautiful. You must all celebrate with me."</span></p>
<<case "Scholarly">>
<p><<print _hostName>> approaches with countless questions.</p>
<p><span class="male">"Your team's coordination mechanics! Your role distribution strategy! Fascinating!"</span></p>
<<case "Prideful">>
<p><<print _hostName>> nods with clear respect to you.</p>
<p><span class="male">"Few can lead a team. You have done so magnificently."</span></p>
<<case "Neutral">>
<p><<print _hostName>> observes your team's victory neutrally.</p>
<p><span class="male">"Your team proved superior. Well coordinated."</span></p>
<</switch>>
<<set $fame += 50>>
<<set $combatFame += 45>>
<<set $gold += 1000>>
</div>
<</widget>>
<<widget "getTeamTournamentDefeat">>
/*
$args[0]: Round (1=First match, 2=Semifinals, 3=Finals)
*/
<<set _roundDefeated to $args[0] ?? 1>>
<<set _hostName to $tournamentHost.name>>
<<set _hostAlign to $tournamentHost.alignment>>
<div class="tournament-defeat">
<<if _roundDefeated is 1>>
<h2>Team Tournament - First Match Defeat</h2>
<p>Your team is defeated in the opening round. The opponents proved better coordinated or stronger.</p>
<p>You're eliminated from the tournament immediately.</p>
<<switch _hostAlign>>
<<case "Righteous">>
<p><<print _hostName>> shows understanding. <span class="male">"Teamwork is difficult. You tried honorably."</span></p>
<<case "Demonic">>
<p><<print _hostName>> shows no interest in defeated teams.</p>
<<case "Hedonistic">>
<p><<print _hostName>> sighs with mild disappointment.</p>
<<case "Scholarly">>
<p><<print _hostName>> makes notes on your team's failure patterns.</p>
<<case "Prideful">>
<p><<print _hostName>> shows no reaction.</p>
<<case "Neutral">>
<p><<print _hostName>> simply observes. <span class="male">"Your team was insufficient."</span></p>
<</switch>>
<<set $combatFame += 5>>
<<set $fame += 5>>
<<set $gold += 150>>
<<elseif _roundDefeated is 2>>
<h2>Team Tournament - Semifinals</h2>
<p>Your team makes it to the semifinals. You've proven superior to most other teams.</p>
<p>But the final four teams are the strongest, and you fall just short.</p>
<<switch _hostAlign>>
<<case "Righteous">>
<p><<print _hostName>> nods respectfully. <span class="male">"Reaching the semifinals shows strong teamwork."</span></p>
<<case "Demonic">>
<p><<print _hostName>> shows increased interest. <span class="male">"Made it to the semis. You're stronger than most."</span></p>
<<case "Hedonistic">>
<p><<print _hostName>> looks impressed. <span class="male">"Impressive team effort. Nearly made finals."</span></p>
<<case "Scholarly">>
<p><<print _hostName>> approaches eagerly. <span class="male">"Your team's tactical adjustments were remarkable!"</span></p>
<<case "Prideful">>
<p><<print _hostName>> acknowledges you slightly.</p>
<<case "Neutral">>
<p><<print _hostName>> observes. <span class="male">"You demonstrated competence as a team."</span></p>
<</switch>>
<<set $combatFame += 18>>
<<set $fame += 18>>
<<set $gold += 350>>
<<elseif _roundDefeated is 3>>
<h2>Team Tournament - Finals</h2>
<p>Your team reaches the finals — the absolute pinnacle of team competition here.</p>
<p>Only two teams remain. But the opposing team proves superior in this final clash.</p>
<p>You are runners-up. Your team is second-best.</p>
<<switch _hostAlign>>
<<case "Righteous">>
<p><<print _hostName>> stands and bows to you and your team.</p>
<p><span class="male">"To reach the finals requires exceptional unity and strength. You have both."</span></p>
<<case "Demonic">>
<p><<print _hostName>> eyes you with dark interest.</p>
<p><span class="male">"You brought a team to the finals. That's impressive. Imagine what you could do for me."</span></p>
<<case "Hedonistic">>
<p><<print _hostName>> looks at your team with clear admiration.</p>
<p><span class="male">"Reaching the finals together... remarkable synchronicity. You all deserve celebration."</span></p>
<<set $corruption += 8>>
<<case "Scholarly">>
<p><<print _hostName>> trembles with excitement.</p>
<p><span class="male">"The coordination in your finals match! The tactical adaptations! Tell me everything!"</span></p>
<<case "Prideful">>
<p><<print _hostName>> stands and offers you formal respect.</p>
<p><span class="male">"You led your team to the finals. Few could do the same."</span></p>
<<case "Neutral">>
<p><<print _hostName>> bows deeply to your team.</p>
<p><span class="male">"You achieved the pinnacle of team competition. That is a legendary accomplishment."</span></p>
<</switch>>
<<set $combatFame += 40>>
<<set $fame += 40>>
<<set $gold += 600>>
<</if>>
</div>
<</widget>>
<!-- ═════════════════════════════════════════════════════════════
HEAVENLY STEP - VICTORY & DEFEAT OUTCOMES
═════════════════════════════════════════════════════════════ -->
<<widget "getHeavenlyStairVictory">>
<<set _hostName to $tournamentHost.name>>
<<set _hostAlign to $tournamentHost.alignment>>
<<set _steps to $hsPlayerStep>>
<div class="tournament-victory">
<h2>🏆 ASCENDED BEYOND ALL!</h2>
<p>The staircase fades as you step onto the highest cloud. <<print _steps>> steps you climbed – more than any other soul.</p>
<p>Below you, the remaining climbers are still struggling upward, but the heavens have already acknowledged you as the victor.</p>
<<if $health lte ($maxhealth * 0.2) and $equippedRobe>>
<p>Your robe is in tatters, evidence of the brutal pressure you endured.</p>
<</if>>
<<switch _hostAlign>>
<<case "Righteous">>
<p><<print _hostName>> bows deeply, eyes full of respect. <span class="male">"To climb the Heavenly Stair and stand above all others… you are a true cultivator. The heavens smile upon you."</span></p>
<<case "Demonic">>
<p><<print _hostName>> grins with dark delight. <span class="male">"You crushed them. You trampled the stairs themselves. YES – this is the hunger that shakes the firmament!"</span></p>
<<case "Hedonistic">>
<p><<print _hostName>> watches you descend the vanished steps with open admiration. <span class="male">"The way you endured… the pain, the pleasure of the climb. Marvellous. You must share a cup with me."</span></p>
<<case "Scholarly">>
<p><<print _hostName>> is frantically scribbling notes. <span class="male">"Incredible! Your step choices, your resource conservation… the statistical improbability of your success! I must document this!"</span></p>
<<case "Prideful">>
<p><<print _hostName>> nods, eyes narrowed with respect. <span class="male">"You did not simply climb. You dominated the stair. Very few can make me say this, but… you have my acknowledgment."</span></p>
<<case "Neutral">>
<p><<print _hostName>> observes calmly. <span class="male">"You are the sole survivor of the stair. The objective is achieved with supreme excellence."</span></p>
<</switch>>
<<set $fame += 60>>
<<set $combatFame += 60>>
<<set $gold += 1200>>
<<set $spiritualRoot += 2>>
</div>
<</widget>>
<<widget "getHeavenlyStairDefeat">>
<<set _hostName to $tournamentHost.name>>
<<set _hostAlign to $tournamentHost.alignment>>
<<set _steps to $hsPlayerStep>>
<<set _rank to $hsPlayerRank>>
<<set _total to $hsTotalClimbers ?? 12>>
<<if _rank lte 3>>
<<set _stage to "final">>
<<elseif _rank lte Math.ceil(_total/2)>>
<<set _stage to "mid">>
<<else>>
<<set _stage to "early">>
<</if>>
<div class="tournament-defeat">
<<if _stage eq "final">>
<h2>🥈 So Close to the Heavens!</h2>
<p>You climbed <<print _steps>> steps, standing among the very best. Only <<if _rank is 2>>one<<else>>two<</if>> climbers went further.</p>
<p>The heavens almost acknowledged you – but not quite.</p>
<<switch _hostAlign>>
<<case "Righteous">>
<p><<print _hostName>> offers you a warm nod. <span class="male">"You nearly touched the sky. That is a feat of immense honor. Stand proud."</span></p>
<<case "Demonic">>
<p><<print _hostName>> studies you with keen interest. <span class="male">"So close to perfection. I will remember your hunger… and your near miss."</span></p>
<<case "Hedonistic">>
<p><<print _hostName>> smiles, intrigued. <span class="male">"The agony of coming so far and yet falling short… it’s almost delicious. You are still remarkable."</span></p>
<<case "Scholarly">>
<p><<print _hostName>> offers rapid-fire questions. <span class="male">"Your decision-making in the final steps! The marginal deficit! Astonishing data!"</span></p>
<<case "Prideful">>
<p><<print _hostName>> gives a slight, grudging nod. <span class="male">"You were among the final few. That is worth a sliver of my respect."</span></p>
<<case "Neutral">>
<p><<print _hostName>> observes with a rare hint of approval. <span class="male">"Top three is a significant achievement. You did not fail."</span></p>
<</switch>>
<<set $fame += 35>>
<<set $combatFame += 35>>
<<set $gold += 600>>
<<elseif _stage eq "mid">>
<h2>⚡ A Respectable Climb</h2>
<p>You ascended <<print _steps>> steps – better than many, but not the best.</p>
<p>The crowd cheers for your effort; you proved yourself a solid cultivator.</p>
<<switch _hostAlign>>
<<case "Righteous">>
<p><<print _hostName>> claps politely. <span class="male">"You persevered. The stair tested you, and you did not falter. Well done."</span></p>
<<case "Demonic">>
<p><<print _hostName>> shrugs, but a flicker of interest remains. <span class="male">"You lasted longer than the rabble. There might be something in you yet."</span></p>
<<case "Hedonistic">>
<p><<print _hostName>> gives you an appreciative glance. <span class="male">"Not the pinnacle, but certainly entertaining. I enjoyed watching you struggle."</span></p>
<<case "Scholarly">>
<p><<print _hostName>> nods as they take notes. <span class="male">"A consistent performance. Your step selection was… adequate."</span></p>
<<case "Prideful">>
<p><<print _hostName>> barely acknowledges you. <span class="male">"You did not embarrass yourself."</span></p>
<<case "Neutral">>
<p><<print _hostName>> observes flatly. <span class="male">"You climbed. You fell. You were not last."</span></p>
<</switch>>
<<set $fame += 15>>
<<set $combatFame += 15>>
<<set $gold += 250>>
<<else>>
<h2>💨 The Stair Rejects You</h2>
<p>After only <<print _steps>> steps the pressure shattered your resolve. You tumbled back to the ground, far from the top.</p>
<p>The higher climbers barely noticed your fall. For you, the heavens remain distant.</p>
<<switch _hostAlign>>
<<case "Righteous">>
<p><<print _hostName>> offers a brief, pitying nod. <span class="male">"The Heavenly Stair shows no mercy. Train harder, and perhaps you will climb further."</span></p>
<<case "Demonic">>
<p><<print _hostName>> scoffs. <span class="male">"Pathetic. You broke before even testing the true climb. Go crawl back to the mortal realm."</span></p>
<<case "Hedonistic">>
<p><<print _hostName>> sighs dramatically. <span class="male">"A shame. I expected more drama. You barely entertained me."</span></p>
<<case "Scholarly">>
<p><<print _hostName>> jots a quick note. <span class="male">"Entry‑level failure. Data logged."</span></p>
<<case "Prideful">>
<p><<print _hostName>> doesn’t even look at you. Not worth the glance.</p>
<<case "Neutral">>
<p><<print _hostName>> states simply: <span class="male">"You are not strong enough."</span></p>
<</switch>>
<<set $fame += 5>>
<<set $combatFame += 5>>
<<set $gold += 80>>
<</if>>
<<if $health lte ($maxhealth * 0.2) and $equippedRobe>>
<p>Your robe is shredded, leaving you humiliated as well as defeated.</p>
<</if>>
</div>
<</widget>><div id="casualSexContainer">
<<CasualSex "the shady merchant" "a high-grade recovery potion" "sub" "vaginal" "Tournament|Region1">>
</div>
<<set $health = $maxhealth>><div class="tournament-lobby">
<h2>⚔️ Tournament Board</h2>
<p>Notices and invitations for upcoming tournaments in the region.</p>
<div class="board-description">
<p>Several scrolls and announcements are posted here. Cultivators gather to discuss the latest tournaments and gossip about the hosts.</p>
</div>
<div class="tournament-actions">
<<link "📋 View Tournament Invitation">>
<<if !$tournamentHost>>
<<generateTournamentHost>>
<</if>>
<<goto "TournamentDetails">>
<</link>>
<<link "🔄 Check for New Tournaments">>
<<set $tournamentHost to null>>
<<goto "TournamentBoard">>
<<generateTournamentHost>>
<</link>>
<<link "⬅️ Return to Town" $passage>><</link>>
</div>
</div><<if !$tournamentHost>>
<<generateTournamentHost>>
<</if>>
<div class="tournament-details">
<h2>Tournament Details</h2>
<div class="host-info">
<h3>Hosted by $tournamentHost.title $tournamentHost.name</h3>
<p><strong>Cultivation:</strong> $tournamentHost.realm $tournamentHost.stage</p>
<p><strong>Alignment:</strong> $tournamentHost.alignment</p>
<p><strong>Location:</strong> $tournamentHost.location</p>
<p><strong>Prize Pool:</strong> $tournamentHost.prize spirit stones</p>
</div>
<<getTournamentLocationDescription $tournamentHost.location>>
<div class="format-info">
<h3>Competition Format</h3>
<<getTournamentFormatDescription $tournamentHost.format>>
</div>
<div class="rumor-section">
<h3>⚠️ Local Rumor</h3>
<p><em>"$tournamentHost.rumor"</em></p>
</div>
<div class="tournament-actions">
<<link "📋 Accept Invitation">>
<<goto "TournamentPrep">>
<</link>>
<<link "❌ Decline">>
<<set $tournamentHost to null>>
<<goto "TournamentBoard">>
<</link>>
</div>
</div><div class="tournament-prep">
<h2>Preparing for Tournament</h2>
<p>You make your way to $tournamentHost.location to register for the tournament.</p>
<p>The venue is <<print either("bustling with activity", "surprisingly quiet", "filled with tense energy", "alive with excitement")>>. Various cultivators from different sects and backgrounds have gathered here, sizing each other up.</p>
<<if $tournamentHost.alignment eq "Demonic">>
<p>You notice shady figures in corners, exchanging money and making bets. The air feels thick with danger and greed.</p>
<<elseif $tournamentHost.alignment eq "Hedonistic">>
<p>Servants in fine silks offer refreshments and entertainment. The atmosphere is luxurious, almost decadent. Everything here screams wealth.</p>
<<elseif $tournamentHost.alignment eq "Scholarly">>
<p>Detailed records of past tournaments are displayed on elaborate scrolls. The host's disciples are taking careful notes on each arriving competitor, studying them intently.</p>
<<elseif $tournamentHost.alignment eq "Prideful">>
<p>You see $tournamentHost.name overseeing preparations personally, barking orders at servants and coordinators with obvious disdain. They demand perfection.</p>
<<elseif $tournamentHost.alignment eq "Righteous">>
<p>Order and fairness are paramount here. Referees are briefing all competitors on the rules of honorable combat, ensuring everyone has an equal chance.</p>
<<else>>
<p>The preparations are methodical and efficient, though you can't quite read $tournamentHost.name's intentions.</p>
<</if>>
<div id="prep-options" class="prep-options">
<h3>Before the tournament starts, you have some time:</h3>
<<link "⚔️ Enter the Tournament">>
<<set $tournamentActive to true>>
<<goto "TournamentStart">>
<</link>>
<br>
<<link "🏃 Train Briefly (+1 Martial Arts, -50 stones)">>
<<if $gold >= 50>>
<<set $gold -= 50>>
<<replace "#prep-options">>
<div class="prep-result training-result">
<h3>Training Session</h3>
<p>You find a secluded corner of the venue and begin to practice. Your movements become more fluid, your strikes more precise.</p>
<p>The training invigorates you. You feel more confident in your technique.</p>
<<startStatChanges>>
<<gainStat "Martial Arts" "basemartialArts" 1 1 40>>
<<showStatChanges>>
<p>Now you're ready to enter the tournament.</p>
<br><<link "⚔️ Enter the Tournament">>
<<set $tournamentActive to true>>
<<goto "TournamentStart">>
<</link>>
<br><<link "❌ Back Out">>
<<set $tournamentHost to null>>
<<set $activeTournament to false>>
<<goto "TournamentBoard">>
<</link>>
</div>
<</replace>>
<<else>>
<<replace "#prep-options">>
<div class="prep-result error-result">
<p>You approach the training grounds, but realize you don't have enough spirit stones to pay for instruction.</p>
<p><strong>You need 50 spirit stones but only have $gold.</strong></p>
<br><<link "Continue Preparing">>
<<replace "#prep-options">>
<div class="prep-options">
<h3>Before the tournament starts, you have some time:</h3>
<<link "⚔️ Enter the Tournament">>
<<set $tournamentActive to true>>
<<goto "TournamentStart">>
<</link>>
<br>
<<link "🧘 Meditate (Calm your mind)">>
<<set $tournamentMeditated to true>>
<<replace "#prep-options">>
<div class="prep-result meditation-result">
<h3>Meditation</h3>
<p>You find a quiet corner and sit in peaceful meditation. The sounds of the venue fade away as you focus inward.</p>
<p>Your mind becomes clear. Doubts dissolve. Your spirit feels calm and centered.</p>
<p>You emerge from meditation feeling mentally sharp and ready to face whatever challenges await.</p>
<br><<link "⚔️ Enter the Tournament">>
<<set $tournamentActive to true>>
<<goto "TournamentStart">>
<</link>>
<br><<link "❌ Back Out">>
<<set $tournamentHost to null>>
<<set $activeTournament to false>>
<<goto "TournamentBoard">>
<</link>>
</div>
<</replace>>
<</link>>
<br><<link "❌ Change Your Mind">>
<<set $tournamentHost to null>>
<<set $activeTournament to false>>
<<goto "TournamentBoard">>
<</link>>
</div>
<</replace>>
<</link>>
</div>
<</replace>>
<</if>>
<</link>>
<br>
<<link "🧘 Meditate (Calm your mind)">>
<<set $tournamentMeditated to true>>
<<replace "#prep-options">>
<div class="prep-result meditation-result">
<h3>Meditation</h3>
<p>You find a quiet corner and sit in peaceful meditation. The sounds of the venue fade away as you focus inward.</p>
<p>Your mind becomes clear. Doubts dissolve. Your spirit feels calm and centered.</p>
<p>You emerge from meditation feeling mentally sharp and ready to face whatever challenges await.</p>
<br><<link "⚔️ Enter the Tournament">>
<<set $tournamentActive to true>>
<<goto "TournamentStart">>
<</link>>
<br><<link "❌ Back Out">>
<<set $tournamentHost to null>>
<<set $activeTournament to false>>
<<goto "TournamentBoard">>
<</link>>
</div>
<</replace>>
<</link>>
<br>
<<link "❌ Change Your Mind">>
<<set $tournamentHost to null>>
<<set $activeTournament to false>>
<<goto "TournamentBoard">>
<</link>>
</div>
</div><div class="tournament-start">
<h2>The Tournament Begins!</h2>
<p>The tournament officially begins. Cultivators gather in the arena as the announcer's voice booms across the venue.</p>
<<getTournamentFormatDescription $tournamentHost.format>>
<p>You feel the weight of anticipation in the air. All around you, cultivators are preparing themselves mentally and physically.</p>
<div class="tournament-start-actions">
<<link "⚔️ Begin Tournament" "TournamentBattle|FormatSpecific">>
<<initializeTournamentFormat $tournamentHost.format>>
<</link>>
</div>
</div><<if !$tournamentData or !$tournamentData.format>>
<<initializeTournamentFormat $tournamentHost.format>>
<</if>>
<<set _format to $tournamentHost.format>>
<!-- ═════════════════════════════════════════════════════════════
SINGLE ELIMINATION - 1v1 DUELS
═════════════════════════════════════════════════════════════ -->
<<if _format eq "Martial Elimination">>
<<TournamentMartialElimination>>
<<elseif _format eq "Arena Survival">>
<<TournamentArenaSurvival>>
<<elseif _format eq "Heavenly Stair Challenge">>
<<HeavenlyStairChallenge>>
<<elseif _format eq "Pill Refining Contest">>
<<PillRefiningTournament>>
<<elseif _format eq "Team Tournament">>
<<TournamentTeamElimination>>
<</if>><div class="battle-container">
<<if $pe eq 0>>
/* --- 1. INITIATIVE & AMBUSH (Round 1 Only) --- */
<<if ndef $battleRound>>
<<set $battleRound = 1>>
<<set _playerSpeed = $agility + Math.floor($luck / 5) + random(1, 100)>>
<<set _enemySpeed = ($currentEnemy.agility || 100) + random(1, 100)>>
<<if _enemySpeed > _playerSpeed>>
<div class="combat-log-panel ambush-alert">
<h3 class="log-title">⚠️ Ambushed!</h3>
<div class="log-entry">
<i>$currentEnemy.fullname strikes before you can react!</i>
<<EnemyAttackAttempt>>
<<if $enemyaction eq "attack success">><<EnemyAttackDamage>>
<<else>><span class="miss-text">You narrowly evaded!</span><</if>>
</div>
</div>
<<if $health lte 0>><<link "Fall in Battle..." $returnpassage>><<set $playerLost to true>><<unset $battleRound>><</link>><</if>>
<<else>>
<div class="combat-log-panel initiative-alert">
<h3 class="log-title">⚡ Initiative Seized</h3>
<div class="log-entry"><i>Your agility grants you the first strike!</i></div>
</div>
<</if>>
<</if>>
<div class="enemy-presentation">
<h2 class="combat-title">Facing: $currentEnemy.fullname</h2>
<div class="enemy-portrait-frame">
<<EnemyImage $currentEnemy.enemyregion $currentEnemy.enemyimage 300>><</EnemyImage>>
</div>
<div class="enemy-stats-wrapper">
<<EnemyBattleTable>>
</div>
</div>
<<if $activePassiveSkill != "">>
<div class="passive-notification-box">
<span class="buff-icon">🌀</span> <<Ability $activePassiveWidget>><</Ability>>
</div>
<</if>>
<div class="combat-actions-panel">
<div class="action-column">
<h3>Martial Stance</h3>
<div class="action-button-container">
<<link "Basic strike" "Battle">>
<<set $pe to 1>><<set $playeraction = "attack">>
<</link>>
<br><<link "Surrender" "Battle">>
<<set $pe to 1>>
<<set $playeraction = "surrender">>
<</link>>
</div>
</div>
<div class="action-column">
<h3>Divine Abilities</h3>
<div class="ability-list">
<<for _i to 0; _i lt $skillInventory.length; _i++>>
<<if ($skillInventory[_i].category eq "attack" or $skillInventory[_i].category eq "special") and $skillInventory[_i].isEquipped eq "true">>
<div class="ability-row">
<div class="ability-info">
<span class="ability-name"><<print $skillInventory[_i].name>></span><br>
<span class="ability-cost">Qi: $skillInventory[_i].energy</span>
</div>
<div class="ability-action">
<<capture _i>>
<<if $energy lt $skillInventory[_i].energy>>
<span class="not-enough-qi">Low Qi</span>
<<else>>
<div class="invoke-button-container">
<<link "Invoke" "Battle">>
<<set $pe = 1>><<set $playeraction = "ability">>
<<set $ability = $skillInventory[_i].widgetname>>
<<set $abilityenergy = $skillInventory[_i].energy>>
<<set $energy -= $abilityenergy>>
<<set $abilitylevel = $skillInventory[_i].level>>
<</link>>
</div>
<</if>>
<</capture>>
</div>
</div>
<</if>>
<</for>>
</div>
</div>
</div>
<<elseif $pe eq 1>>
<div class="combat-log-panel">
<h3 class="log-title">The Exchange</h3>
<div class="log-entry player-turn">
<<if $playeraction eq "attack">>
<b>You</b> attack $currentEnemy.fullname!
<<PlayerAttackAttempt>>
<<if $playeraction eq "attack success">><<PlayerAttackDamage>>
<<else>><span class="miss-text">Your strike missed!</span><</if>>
<<elseif $playeraction eq "ability">>
<div class="ability-execution-style">
<<Ability $ability>><</Ability>>
</div>
<</if>>
<<if $playeraction eq "surrender">>
<br>You have surrendered. You lost the battle.
<<set $health = 0>>
<</if>>
</div>
<hr class="combat-divider">
<div class="log-entry enemy-turn">
<<EnemyStun>>
<<if $enemyaction eq "attack">>
<b>$currentEnemy.fullname</b> retaliates!
<<EnemyAttackAttempt>>
<<if $enemyaction eq "attack success">><<EnemyAttackDamage>>
<<else>><span class="miss-text">The enemy missed!</span><</if>>
<</if>>
</div>
<div class="battle-resolution">
<<if $currentEnemy.NPCcurrenthealth lte 0>>
<<link "Victory! Enemy Slain" $returnpassage>>
<<set $battleWon = true>><<set $defeatedEnemy to $currentEnemy>>
<<set $pe = $nextPe>><<unset $battleRound>>
<</link>>
<<elseif $health lte 0>>
<<link "You have been defeated..." $returnpassage>>
<<set $playerLost to true>><<set $pe to $nextPe += 1>>
<<unset $battleRound>>
<</link>>
<<else>>
/* Force return to 'Battle' passage explicitly */
<<link "Continue the Clash" "Battle">>
<<set $pe = 0>><<set $battleRound++>>
<</link>>
<</if>>
</div>
</div>
<</if>>
</div><div class="battle-container">
<div class="enemy-presentation">
<div class="EnemyCombat-panel" style="display:flex; flex-direction: row; justify-content: center; align-items: center;">
<div class="enemy-portrait-frame">
<<EnemyImage $currentEnemy.enemyregion $currentEnemy.enemyimage 300>><</EnemyImage>>
</div>
<div class="enemy-stats-wrapper">
<<EnemyBattleTable>>
</div>
</div>
</div>
<<if $pe eq 0>>
/* --- INITIATIVE CHECK (battleround) --- */
<<if ndef $battleRound>>
<<set $battleRound = 1>>
<<set _playerSpeed = $agility + Math.floor($luck / 5) + random(1, 100)>>
<<set _enemySpeed = ($currentEnemy.agility || 100) + random(1, 100)>>
<<if _enemySpeed > _playerSpeed>>
<div class="combat-log-panel ambush-alert" style="margin-bottom: 1em;">
<h3 class="log-title" style="color:#ff4c4c;">⚠️ Fast Exchange</h3>
<div class="log-entry">
<i>$currentEnemy.fullname is incredibly swift! They strike before you can finish your salute!</i>
<<EnemyAttackAttempt>>
<<if $enemyaction eq "attack success">><<EnemyAttackDamage>>
<<else>><span class="miss-text">You parried the sudden opening blow!</span><</if>>
</div>
</div>
<<if $health lte 0>>
<div class="battle-resolution">
<<link "Eliminated..." $returnpassage>>
<<set $pe to "lost">><<unset $battleRound>>
<</link>>
</div>
<</if>>
<<else>>
<div class="combat-log-panel initiative-alert">
<h3 class="log-title" style="color:#4ade80;">⚡ Tactical Advantage</h3>
<div class="log-entry"><i>Your focus is absolute. You seize the first move of the match!</i></div>
</div>
<</if>>
<</if>>
<<if $activePassiveSkill != "">>
<div class="passive-notification-box">
<span class="buff-icon">🌀</span> <<Ability $activePassiveWidget>><</Ability>>
</div>
<</if>>
<div class="combat-actions-panel">
<div class="action-column">
<h3>General Actions</h3>
<div class="action-button-container">
<<link "ATTACK" "Battle1">>
<<set $pe to 1>>
<<set $playeraction = "attack">>
<</link>>
</div>
</div>
<div class="action-column">
<h3>Abilities</h3>
<div class="ability-list">
<<for _i to 0; _i lt $skillInventory.length; _i++>>
<<if ($skillInventory[_i].category eq "attack" or $skillInventory[_i].category eq "special") and $skillInventory[_i].isEquipped eq "true">>
<div class="ability-row">
<div class="ability-info">
<span class="ability-name"><<print $skillInventory[_i].name>></span><br>
<span class="ability-cost">Energy cost: $skillInventory[_i].energy</span>
</div>
<div class="ability-action">
<<capture _i>>
<<if $energy lt $skillInventory[_i].energy>>
<span class="not-enough-qi">Not enough energy</span>
<<else>>
<div class="invoke-button-container">
<<link "USE" "Battle1">>
<<set $pe = 1>>
<<set $playeraction = "ability">>
<<set $ability = $skillInventory[_i].widgetname>>
<<set $abilityenergy = $skillInventory[_i].energy>>
<<set $energy -= $abilityenergy>>
<<set $abilitylevel = $skillInventory[_i].level>>
<</link>>
</div>
<</if>>
<</capture>>
</div>
</div>
<</if>>
<</for>>
</div>
</div>
</div>
<<elseif $pe eq 1>>
<div class="combat-log-panel">
<h3 class="log-title">Battle Exchange</h3>
<div class="log-entry player-turn">
<<if $playeraction eq "attack">>
<b>You</b> attempt to hit $currentEnemy.fullname!<br>
<<PlayerAttackAttempt>>
<<if $playeraction eq "attack success">>
<<PlayerAttackDamage>>
<<elseif $playeraction eq "attack failure">>
<span class="miss-text">You missed your attack!</span>
<</if>>
<</if>>
<<if $playeraction eq "ability">>
<div class="ability-execution-style">
<<Ability $ability>><</Ability>>
</div>
<</if>>
</div>
<hr class="combat-divider">
<div class="log-entry enemy-turn">
<<EnemyStun>>
<<if $enemyaction eq "attack">>
<b>$currentEnemy.fullname</b> attacks you!<br>
<<EnemyAttackAttempt>>
<<if $enemyaction eq "attack success">>
<<EnemyAttackDamage>>
<<elseif $enemyaction eq "attack failure">>
<span class="miss-text">$currentEnemy.fullname missed their attack!</span>
<</if>>
<</if>>
</div>
<div class="battle-resolution">
<<if $currentEnemy.NPCcurrenthealth lte 0>>
<<link "The enemy is slain! Victory!" $returnpassage>>
<<set $pe = $nextPe>>
<<unset $battleRound>>
<</link>>
<<elseif $health lte 0>>
<<link "You've lost!" $returnpassage>>
<<set $pe = $nextPe + 1>>
<<unset $battleRound>>
<</link>>
<<else>>
<<link "Continue battle" $passage>>
<<set $pe = 0>>
<<set $battleRound++>>
<</link>>
<</if>>
</div>
</div>
<</if>>
</div><<set _deathChance to 0>>
<<set _pe to 0>>
<img src="images/Story/death.png" width=70%><<nobr>>
<<if $playerSect == "demonic" and $enemySect == "righteous">>
<<set _deathChance += 30>>
<</if>>
<<if $playerSect == "righteous" and $enemySect == "demonic">>
<<set _deathChance += 30>>
<</if>>
<<if $totalPCdemonicreputation > $totalPCrighteousreputation>>
<<set _deathChance += 20>>
<</if>>
<<if $totalPCrighteousreputation > $totalPCdemonicreputation>>
<<set _deathChance += 10>>
<</if>>
<<set _deathRoll to random(1,100)>>
<<if _deathRoll <= _deathChance>>
<p>Your opponent stands over your fallen body, victory burning in their eyes.</p>
<<if $enemySect == "righteous">>
<p>“For the greater good,” they mutter, raising their blade. The pain is brief… then, silence.</p>
<</if>>
<<if $enemySect == "demonic">>
<p>They sneer. “Too weak to live.” The world fades with their laughter echoing in your ears.</p>
<</if>>
<p>But fate is not so simple. As your soul slips from your body, something stirs — a pull, a fracture in time, a second chance.</p>
<<set $regression += 1>>
<<set $hasRegressed = true>>
<p>You awaken with a gasp, cold sweat clinging to your skin. You’re… alive. But weaker. Back to the moment before it all went wrong.</p>
<<link "..............." $returnpassage>> <<set $regression += 1>>
<<set $hasRegressed = true>><</link>>
<<else>>
<p>You were defeated, but your opponent spares you — for now. You live, but only barely.</p>
<<link "Go away" $returnpassage>><<set $health to 1>><<set $playerEnergy to 0>><</link>><</if>>
<</nobr>><div class="battle-container">
<div class="enemy-presentation">
<div class="EnemyCombat-panel" style="display:flex; flex-direction: row; justify-content: center; align-items: center;">
<div class="enemy-portrait-frame">
<<EnemyImage $currentEnemy.enemyregion $currentEnemy.enemyimage 300>><</EnemyImage>>
</div>
<div class="enemy-stats-wrapper">
<<EnemyBattleTable>>
</div>
</div>
</div>
<<if $pe eq 0>>
/* --- INITIATIVE CHECK (battleround) --- */
<<if ndef $battleRound>>
<<set $battleRound = 1>>
<<set _playerSpeed = $agility + Math.floor($luck / 5) + random(1, 100)>>
<<set _enemySpeed = ($currentEnemy.agility || 100) + random(1, 100)>>
<<if _enemySpeed > _playerSpeed>>
<div class="combat-log-panel ambush-alert" style="margin-bottom: 1em;">
<h3 class="log-title" style="color:#ff4c4c;">⚠️ Swift Beast</h3>
<div class="log-entry">
<i>$currentEnemy.fullname lunges before you can react!</i>
<<EnemyAttackAttempt>>
<<if $enemyaction eq "attack success">><<EnemyAttackDamage>>
<<else>><span class="miss-text">You barely dodge the opening strike!</span><</if>>
</div>
</div>
<<if $health lte 0>>
<div class="battle-resolution">
<<link "Eliminated..." "GameOver">>
<<set $pe to "lost">><<unset $battleRound>>
<</link>>
</div>
<</if>>
<<else>>
<div class="combat-log-panel initiative-alert">
<h3 class="log-title" style="color:#4ade80;">⚡ Hunting Instinct</h3>
<div class="log-entry"><i>You anticipate the creature's movements and strike first!</i></div>
</div>
<</if>>
<</if>>
<<if $activePassiveSkill != "">>
<div class="passive-notification-box">
<span class="buff-icon">🌀</span> <<Ability $activePassiveWidget>><</Ability>>
</div>
<</if>>
<div class="combat-actions-panel">
<div class="action-column">
<h3>General Actions</h3>
<div class="action-button-container">
<<link "ATTACK" "HuntBeastsBattle|Region1">>
<<set $pe to 1>><<set $playeraction = "attack">>
<</link>>
</div>
</div>
<div class="action-column">
<h3>Abilities</h3>
<div class="ability-list">
<<for _i to 0; _i lt $skillInventory.length; _i++>>
<<if ($skillInventory[_i].category eq "attack" or $skillInventory[_i].category eq "special") and $skillInventory[_i].isEquipped eq true>>
<div class="ability-row">
<div class="ability-info">
<span class="ability-name"><<print $skillInventory[_i].name>></span><br>
<span class="ability-cost">Energy: $skillInventory[_i].energy</span>
</div>
<div class="ability-action">
<<capture _i>>
<<if $energy lt $skillInventory[_i].energy>>
<span class="not-enough-qi">Low Energy</span>
<<else>>
<div class="invoke-button-container">
<<link "USE" "HuntBeastsBattle|Region1">>
<<set $pe = 1>><<set $playeraction = "ability">>
<<set $ability = $skillInventory[_i].widgetname>>
<<set $abilityenergy = $skillInventory[_i].energy>>
<<set $energy -= $abilityenergy>>
<<set $abilitylevel = $skillInventory[_i].level>>
<</link>>
</div>
<</if>>
<</capture>>
</div>
</div>
<</if>>
<</for>>
</div>
</div>
</div>
<<elseif $pe eq 1>>
<div class="combat-log-panel">
<h3 class="log-title">Hunting Exchange</h3>
<div class="log-entry player-turn">
<<if $playeraction eq "attack">>
<b>You</b> attempt to hit the $currentEnemy.fullname!
<<PlayerAttackAttempt>>
<<if $playeraction eq "attack success">>
<<PlayerAttackDamage>>
<<elseif $playeraction eq "attack failure">>
<span class="miss-text">You missed your attack!</span>
<</if>>
<<elseif $playeraction eq "ability">>
<div class="ability-execution-style">
<<Ability $ability>><</Ability>>
</div>
<</if>>
</div>
<hr class="combat-divider">
<div class="log-entry enemy-turn">
<<EnemyStun>>
<<if $enemyaction eq "attack">>
The <b>$currentEnemy.fullname</b> prepares to attack you!
<<EnemyAttackAttempt>>
<<if $enemyaction eq "attack success">>
<<EnemyAttackDamage>>
<<elseif $enemyaction eq "attack failure">>
<span class="miss-text">The $currentEnemy.fullname missed their attack!</span>
<</if>>
<</if>>
</div>
<div class="battle-resolution">
<<if $currentEnemy.NPCcurrenthealth lte 0>>
<div class="victory-loot-panel" style="margin-bottom: 1em;">
<p style="color:#4ade80;">You feel more experienced after winning against the $currentEnemy.fullname!</p>
<<set _totalWeight = 0>>
<<for _drop range $currentEnemy.enemyLoot>>
<<set _totalWeight += _drop.chance>>
<</for>>
<<set _roll = random(1, _totalWeight)>>
<<set _running = 0>>
<<set $loot = null>>
<<for _drop range $currentEnemy.enemyLoot>>
<<set _running += _drop.chance>>
<<if _roll <= _running>>
<<set $loot = _drop.item>>
<<break>>
<</if>>
<</for>>
<p>You loot the corpse of the <<print $currentEnemy.fullname>> and find: <b><<print $loot.name>></b>.</p>
<<AddItemToInventory $loot>>
</div>
<<link "The enemy is slain! Victory!" $returnpassage>>
<<set $pe = 0>>
<<set $exp = $exp + $currentEnemy.enemyXP>>
<<unset $battleRound>>
<</link>>
<<elseif $health lte 0>>
<<link "You've lost!" "GameOver">>
<<set $pe to "lost">><<unset $battleRound>>
<</link>>
<<else>>
<<link "Continue battle" $passage>>
<<set $pe = 0>>
<<set $battleRound++>>
<</link>>
<</if>>
</div>
</div>
<</if>>
</div><div class="battle-container">
<div class="enemy-presentation">
<div class="EnemyCombat-panel" style="display:flex; flex-direction: row; justify-content: center; align-items: center;">
<div class="enemy-portrait-frame">
<<EnemyImage $currentEnemy.enemyregion $currentEnemy.enemyimage 300>><</EnemyImage>>
</div>
<div class="enemy-stats-wrapper">
<<EnemyBattleTable>>
</div>
</div>
</div>
<<if $pe eq 0>>
/* --- INITIATIVE & AMBUSH (Round 1 Only) --- */
<<if ndef $battleRound>>
<<set $battleRound = 1>>
<<set _playerSpeed = $agility + Math.floor($luck / 5) + random(1, 100)>>
<<set _enemySpeed = ($currentEnemy.agility || 100) + random(1, 100)>>
<<if _enemySpeed > _playerSpeed>>
<div class="combat-log-panel ambush-alert" style="margin-bottom: 1em;">
<h3 class="log-title" style="color:#ff4c4c;">⚠️ Ambushed!</h3>
<div class="log-entry">
<i>$currentEnemy.fullname strikes before you can react!</i>
<<EnemyAttackAttempt>>
<<if $enemyaction eq "attack success">><<EnemyAttackDamage>>
<<else>><span class="miss-text">You narrowly evaded!</span><</if>>
</div>
</div>
<<if $health lte 0>>
<div class="battle-resolution">
<<link "Fall in Battle..." $returnpassage>>
<<set $playerLost to true>><<unset $battleRound>>
<</link>>
</div>
<</if>>
<<else>>
<div class="combat-log-panel initiative-alert">
<h3 class="log-title" style="color:#4ade80;">⚡ Initiative Seized</h3>
<div class="log-entry"><i>Your agility grants you the first strike!</i></div>
</div>
<</if>>
<</if>>
<<if $activePassiveSkill != "">>
<div class="passive-notification-box">
<span class="buff-icon">🌀</span> <<Ability $activePassiveWidget>><</Ability>>
</div>
<</if>>
<div class="combat-actions-panel">
<div class="action-column">
<h3>Martial Stance</h3>
<div class="action-button-container">
<<link "BASIC STRIKE" "MissionBattle1">>
<<set $pe to 1>><<set $playeraction = "attack">>
<</link>>
</div>
</div>
<div class="action-column">
<h3>Divine Abilities</h3>
<div class="ability-list">
<<for _i to 0; _i lt $skillInventory.length; _i++>>
<<if ($skillInventory[_i].category eq "attack" or $skillInventory[_i].category eq "special") and $skillInventory[_i].isEquipped eq "true">>
<div class="ability-row">
<div class="ability-info">
<span class="ability-name"><<print $skillInventory[_i].name>></span><br>
<span class="ability-cost">Qi: $skillInventory[_i].energy</span>
</div>
<div class="ability-action">
<<capture _i>>
<<if $energy lt $skillInventory[_i].energy>>
<span class="not-enough-qi">Low Qi</span>
<<else>>
<div class="invoke-button-container">
<<link "INVOKE" "MissionBattle1">>
<<set $pe = 1>><<set $playeraction = "ability">>
<<set $ability = $skillInventory[_i].widgetname>>
<<set $abilityenergy = $skillInventory[_i].energy>>
<<set $energy -= $abilityenergy>>
<<set $abilitylevel = $skillInventory[_i].level>>
<</link>>
</div>
<</if>>
<</capture>>
</div>
</div>
<</if>>
<</for>>
</div>
</div>
</div>
<<elseif $pe eq 1>>
<div class="combat-log-panel">
<h3 class="log-title">The Exchange</h3>
<div class="log-entry player-turn">
<<if $playeraction eq "attack">>
<b>You</b> attack $currentEnemy.fullname!
<<PlayerAttackAttempt>>
<<if $playeraction eq "attack success">><<PlayerAttackDamage>>
<<else>><span class="miss-text">Your strike missed!</span><</if>>
<<elseif $playeraction eq "ability">>
<div class="ability-execution-style">
<<Ability $ability>><</Ability>>
</div>
<</if>>
</div>
<hr class="combat-divider">
<div class="log-entry enemy-turn">
<<EnemyStun>>
<<if $enemyaction eq "attack">>
<b>$currentEnemy.fullname</b> retaliates!
<<EnemyAttackAttempt>>
<<if $enemyaction eq "attack success">><<EnemyAttackDamage>>
<<else>><span class="miss-text">The enemy missed!</span><</if>>
<</if>>
</div>
<div class="battle-resolution">
<<if $currentEnemy.NPCcurrenthealth lte 0>>
<<link "Victory! Enemy Slain" $returnpassage>>
<<set $battleWon = true>><<set $defeatedEnemy to $currentEnemy>>
<<set $pe = $nextPe>><<unset $battleRound>>
<</link>>
<<elseif $health lte 0>>
<<link "You have been defeated..." $returnpassage>>
<<set $playerLost to true>><<set $pe to $nextPe += 1>>
<<unset $battleRound>>
<</link>>
<<else>>
<<link "Continue the Clash" "MissionBattle1">>
<<set $pe = 0>><<set $battleRound++>>
<</link>>
<</if>>
</div>
</div>
<</if>>
</div><<nobr>>
<<if $pe eq 0>>
<br>You are fighting $currentEnemy.fullname !
<br><<EnemyImage $currentEnemy.enemyregion $currentEnemy.enemyimage 300>><</EnemyImage>>
<br><b>General Actions</b>:
<br><<link "Attack" "TavernBattle">>
<<set $pe to 1>>
<<set $playeraction = "attack">>
<</link>>
<br><<link "Surrender" "TavernBattle">>
<<set $pe to 1>>
<<set $playeraction = "surrender">>
<</link>>
<table class="abilities-table">
<td>
<b>Abilities</b>:
<<for _i to 0; _i lt $skillInventory.length; _i++>>\
<<if ($skillInventory[_i].category eq "attack" or $skillInventory[_i].category eq "special") and $skillInventory[_i].isEquipped eq "true">>
<br><<print $skillInventory[_i].name>> (Energy cost: $skillInventory[_i].energy )
<<capture _i>>
<<if $energy lt $skillInventory[_i].energy>><i>Not enough energy</i>
<<else>> <<link "Use" "TavernBattle">>
<<set $pe = 1>><<set $playeraction = "ability">> <<set $ability = $skillInventory[_i].widgetname>> <<set $abilityenergy = $skillInventory[_i].energy>><<set $energy -= $abilityenergy>> <<set $abilitylevel = $skillInventory[_i].level>> <</link>> <</if>>
<</capture>>
<</if>>
<</for>>
</td>
</table>
<<if $activePassiveSkill != "">>
<<Ability $activePassiveWidget>><</Ability>>
<</if>>
<<EnemyBattleTable>>
<<elseif $pe eq 1>>
<br><<if $playeraction eq "attack">>You attempt to hit the $currentEnemy.fullname !
<<PlayerAttackAttempt>>
<<if $playeraction = "attack success">>
<br><<PlayerAttackDamage>>
<<elseif $playeraction eq "attack failure">>
<br>You missed your attack!
<</if>><</if>>
<<EnemyStun>>
<br><<if $enemyaction eq "attack">>The $currentEnemy.fullname attacks you!
<<EnemyAttackAttempt>>
<<if $enemyaction = "attack success">>
<br><<EnemyAttackDamage>>
<<elseif $enemyaction eq "attack failure">>
<br>The $currentEnemy.fullname missed their attack!
<</if>><</if>>
<<if $playeraction eq "ability">>
<br><<Ability $ability>><</Ability>><</if>>
<<if $playeraction eq "surrender">>
<br>You have surrendered. You lost the battle.
<<set $health = 0>>
<</if>>
<br><<if $currentEnemy.NPCcurrenthealth lte 0>><<link "The enemy is defeated! Victory!" $returnpassage>><<set $pe = $nextPe>><</link>>
<br><<elseif $health lte 0>><<link "You've lost...." $returnpassage>><<set $pe = $nextPe += 1>><</link>>
<br><<else>><<link "Continue battle" $passage>><<set $pe = 0>><</link>>
<</if>>
<</if>>
<</nobr>><div class="battle-container">
<div class="enemy-presentation">
<div class="EnemyCombat-panel" style="display:flex; flex-direction: row; justify-content: center; align-items: center;">
<div class="enemy-portrait-frame">
<<EnemyImage $currentEnemy.enemyregion $currentEnemy.enemyimage 300>><</EnemyImage>>
</div>
<div class="enemy-stats-wrapper">
<<EnemyBattleTable>>
</div>
</div>
</div>
<<if $pe eq 0>>
/* --- 1. TOURNAMENT INITIATIVE CHECK --- */
<<if ndef $battleRound>>
<<set $battleRound = 1>>
<<set _playerSpeed = $agility + Math.floor($luck / 5) + random(1, 100)>>
<<set _enemySpeed = ($currentEnemy.agility || 100) + random(1, 100)>>
<<if _enemySpeed > _playerSpeed>>
<div class="combat-log-panel ambush-alert" style="margin-bottom: 1em;">
<h3 class="log-title" style="color:#ff4c4c;">⚠️ Fast Exchange</h3>
<div class="log-entry">
<i>$currentEnemy.fullname is incredibly swift! They strike before you can finish your salute!</i>
<<EnemyAttackAttempt>>
<<if $enemyaction eq "attack success">><<EnemyAttackDamage>>
<<else>><span class="miss-text">You parried the sudden opening blow!</span><</if>>
</div>
</div>
<<if $health lte 0>>
<div class="battle-resolution">
<<link "Eliminated from the Tournament..." "Tournament|Region1">>
<<set $pe to "lost">><<unset $battleRound>>
<</link>>
</div>
<</if>>
<<else>>
<div class="combat-log-panel initiative-alert">
<h3 class="log-title" style="color:#4ade80;">⚡ Tactical Advantage</h3>
<div class="log-entry"><i>Your focus is absolute. You seize the first move of the match!</i></div>
</div>
<</if>>
<</if>>
<<if $activePassiveSkill != "">>
<div class="passive-notification-box">
<span class="buff-icon">🌀</span> <<Ability $activePassiveWidget>><</Ability>>
</div>
<</if>>
<div class="combat-actions-panel">
<div class="action-column">
<h3>Martial Stance</h3>
<div class="action-button-container">
<<link "BASIC STRIKE" "TournamentBattle:Martial Elimination">>
<<set $pe to 1>><<set $playeraction = "attack">>
<</link>>
</div>
</div>
<div class="action-column">
<h3>Divine Abilities</h3>
<div class="ability-list">
<<for _i to 0; _i lt $skillInventory.length; _i++>>
<<if ($skillInventory[_i].category eq "attack" or $skillInventory[_i].category eq "special") and $skillInventory[_i].isEquipped eq "true">>
<div class="ability-row">
<div class="ability-info">
<span class="ability-name"><<print $skillInventory[_i].name>></span><br>
<span class="ability-cost">Qi: $skillInventory[_i].energy</span>
</div>
<div class="ability-action">
<<capture _i>>
<<if $energy lt $skillInventory[_i].energy>>
<span class="not-enough-qi">Low Qi</span>
<<else>>
<div class="invoke-button-container">
<<link "INVOKE" "TournamentBattle:Martial Elimination">>
<<set $pe = 1>><<set $playeraction = "ability">>
<<set $ability = $skillInventory[_i].widgetname>>
<<set $abilityenergy = $skillInventory[_i].energy>>
<<set $energy -= $abilityenergy>>
<<set $abilitylevel = $skillInventory[_i].level>>
<</link>>
</div>
<</if>>
<</capture>>
</div>
</div>
<</if>>
<</for>>
</div>
</div>
</div>
<<elseif $pe eq 1>>
<div class="combat-log-panel">
<h3 class="log-title">Tournament Exchange</h3>
<div class="log-entry player-turn">
<<if $playeraction eq "attack">>
<b>You</b> strike at $currentEnemy.fullname!
<<PlayerAttackAttempt>>
<<if $playeraction eq "attack success">><<PlayerAttackDamage>>
<<else>><span class="miss-text">Your opponent deftly evaded!</span><</if>>
<<elseif $playeraction eq "ability">>
<div class="ability-execution-style">
<<Ability $ability>><</Ability>>
</div>
<</if>>
</div>
<hr class="combat-divider">
<div class="log-entry enemy-turn">
<<EnemyStun>>
<<if $enemyaction eq "attack">>
<b>$currentEnemy.fullname</b> retaliates!
<<EnemyAttackAttempt>>
<<if $enemyaction eq "attack success">><<EnemyAttackDamage>>
<<else>><span class="miss-text">You parried the counter-attack!</span><</if>>
<</if>>
</div>
<div class="battle-resolution">
<<if $currentEnemy.NPCcurrenthealth lte 0>>
<<if $tournamentData.round lt 4>>
<p>You advance to the next round!</p>
<<link "Victory! You've advanced!" $returnpassage>>
<<set $pe = 0>>
<<unset $battleRound>>
<<set $tournamentData.wins += 1>>
<<set $tournamentData.round += 1>>
<</link>>
<<else>>
<p>You've won the championship!</p>
<<link "Victory! You've advanced!" $returnpassage>>
<<unset $battleRound>>
<<set $tournamentData.wins += 1>>
<<set $pe to 6>>
<</link>>
<</if>>
<<elseif $health lte 0>>
<<link "Defeat! Eliminated" $returnpassage>>
<<set $pe to "lost">><<unset $battleRound>>
<</link>>
<<else>>
<<link "Continue the Match" "TournamentBattle:Martial Elimination">>
<<set $pe = 0>><<set $battleRound++>>
<</link>>
<</if>>
</div>
</div>
<</if>>
</div>
<!--======================TEAM TOURNAMENT======================================== --><div class="battle-container">
<div style="display: flex; flex-direction: row; justify-content: space-between; align-items: flex-start; gap: 15px; width: 100%;">
<div style="flex: 1;">
<h3 style="text-align: center; color: #074e23; font-family: 'Cinzel Decorative', serif;">Your Team</h3>
<<AllyGroupBattleTable>>
</div>
<div style="flex: 1;">
<h3 style="text-align: center; color: #660000; font-family: 'Cinzel Decorative', serif;">Enemy Team</h3>
<<EnemyGroupBattleTable>>
</div>
</div>
<<if $pe eq 0>>
/* --- 1. TOURNAMENT INITIALIZATION --- */
<<if ndef $battleRound>>
<<set $battleRound = 1>>
<</if>>
<<if $activePassiveSkill != "">>
<div class="passive-notification-box">
<span class="buff-icon">🌀</span> <<Ability $activePassiveWidget>><</Ability>>
</div>
<</if>>
<div class="combat-actions-panel">
<div class="action-column">
<h3>Martial Stance</h3>
<div class="action-button-container">
<<for _i to 0; _i lt $enemyTeam.length; _i++>>
<<if $enemyTeam[_i].NPCcurrenthealth gt 0>>
<<capture _i>>
<<link "BASIC STRIKE at <<print $enemyTeam[_i].fullname>>">>
<<set $playerTargetIdx = _i>>
<<set $playeraction = "attack">>
<<set $pe = 1>>
<<goto "TournamentBattle:Team Elimination">>
<</link>><br>
<</capture>>
<</if>>
<</for>>
</div>
</div>
<div class="action-column">
<h3>Divine Abilities</h3>
<div class="ability-list">
<<for _i to 0; _i lt $skillInventory.length; _i++>>
<<if ($skillInventory[_i].category eq "attack" or $skillInventory[_i].category eq "special") and $skillInventory[_i].isEquipped eq "true">>
<div class="ability-row">
<div class="ability-info">
<span class="ability-name"><<print $skillInventory[_i].name>></span><br>
<span class="ability-cost">Qi: <<print $skillInventory[_i].energy>></span>
</div>
<div class="ability-action">
<<capture _i>>
<<if $energy lt $skillInventory[_i].energy>>
<span class="not-enough-qi">Low Qi</span>
<<else>>
<<link "INVOKE">>
<<set $playerTargetIdx = 0>>
<<set $playeraction = "ability">>
<<set $ability = $skillInventory[_i].widgetname>>
<<set $abilityenergy = $skillInventory[_i].energy>>
<<set $energy -= $abilityenergy>>
<<set $abilitylevel = $skillInventory[_i].level>>
<<set $pe = 1>>
<<goto "TournamentBattle:Team Elimination">>
<</link>>
<</if>>
<</capture>>
</div>
</div>
<</if>>
<</for>>
</div>
</div>
</div>
<<elseif $pe eq 1>>
<div class="combat-log-panel">
<h3 class="log-title">⚔️ Team Combat Exchange - Round <<print $battleRound>></h3>
<!-- PLAYER TURN -->
<div class="log-entry player-turn">
<<if $playeraction eq "attack">>
<b>You</b> strike at <<print $enemyTeam[$playerTargetIdx].fullname>>!
<<PlayerTeamAttackAttempt>>
<<if $playeraction eq "attack success">>
<<PlayerTeamAttackDamage>>
<<else>>
<span class="miss-text">Your opponent deftly evaded!</span>
<</if>>
<<elseif $playeraction eq "ability">>
<div class="ability-execution-style">
<<Ability $ability>><</Ability>>
</div>
<</if>>
</div>
<hr class="combat-divider">
<!-- ALLIES AUTO-ATTACK -->
<div class="log-entry ally-turn">
<b>Your Allies Counter:</b><br>
<<for _allyIdx to 0; _allyIdx lt $allyTeam.length; _allyIdx++>>
<<if $allyTeam[_allyIdx].NPCcurrenthealth gt 0>>
<!-- Ally picks random alive enemy -->
<<set _aliveEnemies = []>>
<<for _e to 0; _e lt $enemyTeam.length; _e++>>
<<if $enemyTeam[_e].NPCcurrenthealth gt 0>>
<<set _aliveEnemies.push(_e)>>
<</if>>
<</for>>
<<if _aliveEnemies.length gt 0>>
<<set _allyTargetIdx = _aliveEnemies[Math.floor(Math.random() * _aliveEnemies.length)]>>
<p style="margin: 5px 0;"><b><<print $allyTeam[_allyIdx].fullname>></b> attacks <<print $enemyTeam[_allyTargetIdx].fullname>>!</p>
<<AllyAttackAttempt $allyTeam[_allyIdx] $enemyTeam[_allyTargetIdx]>>
<<if $allyaction eq "attack success">>
<<AllyAttackDamage $allyTeam[_allyIdx] $enemyTeam[_allyTargetIdx]>>
<<else>>
<span class="miss-text">The attack is evaded!</span>
<</if>>
<</if>>
<</if>>
<</for>>
</div>
<hr class="combat-divider">
<!-- ENEMIES AUTO-ATTACK -->
<div class="log-entry enemy-turn">
<b>Enemy Counter-Attack:</b><br>
<<for _enemyIdx to 0; _enemyIdx lt $enemyTeam.length; _enemyIdx++>>
<<if $enemyTeam[_enemyIdx].NPCcurrenthealth gt 0>>
<!-- Enemy picks random alive target (60% player, 40% ally) -->
<<set _aliveAllies = []>>
<<for _a to 0; _a lt $allyTeam.length; _a++>>
<<if $allyTeam[_a].NPCcurrenthealth gt 0>>
<<set _aliveAllies.push(_a)>>
<</if>>
<</for>>
<<set _targetChoice = random(1, 100)>>
<<if _aliveAllies.length eq 0 or _targetChoice lte 60>>
<!-- ATTACK PLAYER -->
<p style="margin: 5px 0;"><b><<print $enemyTeam[_enemyIdx].fullname>></b> attacks you!</p>
<<EnemyTeamAttackAttempt $enemyTeam[_enemyIdx] {NPCagility: $agility, NPCdef: $def} true>>
<<if $enemyaction eq "attack success">>
<<EnemyTeamAttackDamage $enemyTeam[_enemyIdx] {NPCagility: $agility, NPCdef: $def} true>>
<<else>>
<span class="miss-text">You parried the attack!</span>
<</if>>
<<else>>
<!-- ATTACK RANDOM ALLY -->
<<set _targetAllyIdx = _aliveAllies[Math.floor(Math.random() * _aliveAllies.length)]>>
<p style="margin: 5px 0;"><b><<print $enemyTeam[_enemyIdx].fullname>></b> attacks <<print $allyTeam[_targetAllyIdx].fullname>>!</p>
<<EnemyTeamAttackAttempt $enemyTeam[_enemyIdx] $allyTeam[_targetAllyIdx] false>>
<<if $enemyaction eq "attack success">>
<<EnemyTeamAttackDamage $enemyTeam[_enemyIdx] $allyTeam[_targetAllyIdx] false>>
<<else>>
<span class="miss-text">The ally parried the attack!</span>
<</if>>
<</if>>
<</if>>
<</for>>
</div>
<!-- BATTLE RESOLUTION -->
<div class="battle-resolution">
<<set _enemyAlive = 0>>
<<set _playerAlive = ($health gt 0) ? 1 : 0>>
<<set _allyAlive = 0>>
<<for _i to 0; _i lt $enemyTeam.length; _i++>>
<<if $enemyTeam[_i].NPCcurrenthealth gt 0>>
<<set _enemyAlive += 1>>
<</if>>
<</for>>
<<for _i to 0; _i lt $allyTeam.length; _i++>>
<<if $allyTeam[_i].NPCcurrenthealth gt 0>>
<<set _allyAlive += 1>>
<</if>>
<</for>>
<!-- VICTORY -->
<<if _enemyAlive eq 0>>
<<if $tournamentData.round lt 4>>
<p>You advance to the next round!</p>
<<link "Victory! You've advanced!" $returnpassage>>
<<unset $battleRound>>
<<set $tournamentData.wins += 1>>
<<set $tournamentData.round += 1>>
<<set $enemyTeam = null>>
<<unset $enemyAlly1>>
<<unset $enemyAlly2>>
<<unset $enemyAlly3>>
<<unset $enemyAlly4>>
<</link>>
<<else>>
<p>You've won the championship!</p>
<<link "Victory! You've advanced!" $returnpassage>>
<<unset $battleRound>>
<<set $tournamentData.wins += 1>>
<<set $pe to 6>>
<</link>>
<</if>>
<!-- DEFEAT - Player dead and no allies -->
<<elseif $health lte 0 and _allyAlive eq 0>>
<p style="color: #ff4444; font-weight: bold;">Your team has been eliminated!</p>
<<link "Defeat! Eliminated from Tournament" $returnpassage>>
<<set $pe = "lost">>
<<unset $battleRound>>
<</link>>
<!-- CONTINUE BATTLE -->
<<else>>
<<link "Continue the Match">>
<<set $pe = 0>>
<<set $battleRound++>>
<<unset $playerTargetIdx>>
<<unset $playeraction>>
<<goto "TournamentBattle:Team Elimination">>
<</link>>
<</if>>
</div>
</div>
<</if>>
</div><<if $regioneventid eq "reg_1">>
<!--The Bamboo Grove of Whispers -->
<<if $pe eq 0>>
The grove is hushed, save for the sigh of bamboo swaying like an endless sea—thousands upon thousands of stalks bending and straightening in a rhythm that feels almost like breathing. The air itself seems ancient here, layered with centuries of spiritual accumulation. Yet beneath the rustle, whispers slither through the leaves—too deliberate, too purposeful to be mere wind.
They curl around your thoughts like living things, beckoning you deeper into the green darkness… or tempting you to open your spirit to them, to hear what voices from beyond the veil wish to impart.
<br>[[Follow the whispers->NormalEvents][$pe=1]]
<br>[[Meditate within the grove ->NormalEvents][$pe=2]]
<br><<link "Leave silently" $passage>><</link>>
<<elseif $pe eq 1>>
<<WhisperingShade>>
<<BeforeBattle>>
You follow the eerie voices deeper into the grove, drawn by something you cannot name. The air thickens until each breath feels substantial, as if you're inhaling the spiritual essence of the place itself. Qi gathers here, coalescing in ways that defy natural law.
A ghostly cultivator steps from the shadows—or perhaps the shadows step back to reveal what was always there. His form flickers like candlelight, neither fully present nor entirely absent. His eyes are hollow but fierce, burning with an ancient rage that transcends death itself. He wears robes from an era long forgotten, their embroidery faded by centuries. His silence is more eloquent than any scream—it speaks of grudges nursed across lifetimes, of promises broken, of cultivation paths severed before their natural conclusion.
You must fight for the whispers to fade. This shade will not rest while you draw breath in his domain.
<br><<link "Draw your weapon and prepare to fight" "Battle1">><<set $returnpassage to passage()>><<set $passage to "Battle1">><<set $pe to 0>><<set $nextPe to 3>><</link>>
<br><<link "Retreat" $passage>><</link>>
<<elseif $pe eq 2>>
You cross your legs beneath the whispering bamboo, shutting your eyes and sinking into a state between waking and dreaming. Your breathing slows, your heartbeat becomes the drum that marks time in this place.
The voices seep into your mind—at first a storm of incomprehensible nonsense, the babbling of a thousand mouths speaking in tongues long dead. But gradually, gradually, threads of meaning reveal themselves like gold drawn from sand. Forgotten teachings crystallize in your consciousness. Lost sutras that were burned from the world's libraries suddenly make perfect sense. Riddles of mortality and transcendence whisper their answers, tantalizing and profound.
Your qi flows steadier, like a river that had been dammed for centuries, now finding its true course once more. The blockages in your spirit dissolve. When you finally open your eyes and rise to your feet, the grove feels less haunting—more like a sanctuary, even. Yet a lingering sense of being watched trails behind you as you stand, as if the whispers are following, content for now to wait.
<br><<startStatChanges>>
<br><<gainStat "insight" "baseinsight" 1 0 40 "Insight">>
<br><<showStatChanges>>
<br><<link "Leave" $passage>><</link>>
<<elseif $pe eq 3>>
The ghostly cultivator lets out a silent wail as your strike severs his form—a sound that has no sound, but that echoes in your mind nonetheless. He dissolves into threads of light that scatter among the bamboo like fireflies fleeing the dawn, and the whispers at last fall utterly, achingly silent.
The grove exhales. The weight that pressed against your spirit lifts.
Among the fading motes of spiritual energy, you find a shard of jade—no bigger than your thumb—etched with runes of exquisite complexity. It hums faintly with residual power, as if the cultivator's essence has been preserved within it, suspended between life and death, trapped and waiting.
<br><<startStatChanges>>
<br><<gainStat "insight" "baseinsight" 1 0 40 "Insight">>
<br><<showStatChanges>>
<br><<link "Leave the grove" "Map|Region1">><</link>>
<<elseif $pe eq 4>>
The shade's blade pierces your defenses with contemptuous ease—what good are the techniques of the living against an opponent who has already transcended death? Its cold touch drags at your very soul, as if it seeks to drag you down into the abyss with it. The bamboo leans closer, its stalks rustling with something that sounds disturbingly like laughter, and the whispers transform into accusations—your failures, your weaknesses, every moment you have disappointed yourself.
With the last of your will, you stagger free from the grove, your robes torn, your qi depleted. Though you live, though you escaped, your qi feels frayed and tainted by lingering resentment—the shade's final curse, a poison that will take days to purge.
<br><<link "Stumble away from the grove" "Map|Region1">><</link>>
<</if>>
<<elseif $regioneventid eq "reg_2">>
<<if $pe eq 0>>
<!-- The Crying Lotus-->
<img src="images/Story/bloodlotus.jpg" width=512>
A lotus blooms in the middle of a bloodied pond—impossible, terrible, beautiful. Its petals are the color of fresh wounds, a crimson so vivid it seems to pulse with supernatural life. The stalk is black as obsidian, and from its heart drips a single crystalline tear that hangs suspended as if time itself has paused around it. The tear never falls; it simply hovers, weeping eternal sorrow.
The pond itself reeks of tragedy. The water is murky with old blood, yet somehow the lotus remains pristine, untainted—as if beauty and horror have reached an eternal stalemate in this place. Whispers drift across the surface of the water—prayers? Curses? The anguished cries of the dead? You cannot tell. The boundary between divine and profane has blurred here.
This lotus should not exist. Yet it does.
<br>[[Touch the lotus->NormalEvents][$pe=1]]
<br>[[Sing to the lotus ->NormalEvents][$pe=2]]
<br><<link "Leave silently" $passage>><</link>>
<<elseif $pe eq 1>>
You reach out and touch the tear. The moment your finger makes contact, it shatters like glass—but the sensation that follows is anything but sharp.
The liquid heat rolls onto your skin, searing like molten metal, hot enough to blister. Yet simultaneously it feels like ice water, freezing your veins, your blood, your very essence. Pain and numbness war within you as you stagger backward, crying out.
For a moment—just a moment—your vision cracks open and you see beyond the veil. Endless rivers of blood. Battlefields where flowers like this one bloom from consecrated ground. Empires built on the corpses of cultivators more powerful than you can imagine. Wars fought over a single petal, a single seed, because this lotus grants clarity—true spiritual insight that comes only from witnessing catastrophe.
When your vision finally clears, you find yourself on your knees at the pond's edge. Your hand trembles as you reach down to find a seed—the Iron-Blood Lotus Seed—still warm from the tear, pulsing with ancient power.
Your soul feels steadier now. Tempered by what you have witnessed. Less vulnerable to deceit, to illusion, to the tricks that demons and spirits love to play on the innocent.
<br><<startStatChanges>>
<br><<gainStat "spiritualRoot" "basespiritualRoot" 2 0 40 "Spiritual Root">>
<br><<showStatChanges>>
<br><<link "Leave" $passage>><</link>>
<br><<AddItemToInventory $ironbloodlotusseed>>
<<elseif $pe eq 2>>
You begin to hum—a gentle melody, something ancient and soothing, a lullaby that mothers once sang to calm children terrified of the dark. The melody flows from you like silk unrolling, and something extraordinary happens.
The blood-stained pond begins to still. The frantic whispers that plagued the air fade into silence. The lotus itself tilts toward you, as if responding to the beauty of your song. The suspended tear—that crystalline jewel that has hung in eternal suspension—finally condenses and falls, landing gently in your outstretched palm.
It shimmers with purity and potential, untouched by the corruption that surrounds it. You can see it, practically feel it: this seed contains secrets that alchemists would kill for. With this, you could create medicines that transcend mortal understanding. Cultivation pills that breach barriers thought unbreachable. The very essence of enlightenment, distilled and waiting.
Your insight deepens as you hold it. The music has opened channels in your mind that were previously sealed.
<br><<startStatChanges>>
<br><<gainStat "insight" "baseinsight" 2 0 40 "Insight">>
<br><<showStatChanges>>
<br><<link "Leave" $passage>><</link>>
<br><<AddItemToInventory $ironbloodlotusseed>>
<</if>>
<<elseif $regioneventid eq "reg_3">>
<<if $pe eq 0>>
Amid shattered stone and mossy ruins, you find a jug half-buried in earth.
The seal is old, the clay cracked, yet from within drifts a fragrance so potent it bends your knees. It is wine of the heavens, once brewed by a hand that defied mortality.
<br>[[Drink->NormalEvents][$pe=1]]
<br>[[Save it ->NormalEvents][$pe=2]]
<br><<link "Leave silently" $passage>><</link>>
<<elseif $pe eq 1>>
The wine is wild fire and starlight. Your body stumbles, your laugh escapes unbidden. Power surges, unbalanced and fierce. You may fall, or you may ascend-only fate decides tonight.
<<set _roll to random(0,100)>>
<<if _roll gte 70>>
You've failed to grasp essence of power!
Your experience has slightly decreased!
<<set $exp -= 0.1*$exp>>
<<else>>
You've succeeded!
You've grasped essence of power! Your experience has increased slightly!
<br><<startStatChanges>>
<br><<gainExp 150 700>>
<br><<showStatChanges>>
<</if>>
<br><<link "Leave" $passage>><</link>>
<<elseif $pe eq 2>>
With iron will, you force the jug's scent from your lungs and reseal it. The fragrance lingers like celestial music, promising strength when fate grows cruel.
Legends whisper that this wine tempers tribulation fire-what is calamity to one who laughs at the heavens?
<br><<link "Leave" $passage>><</link>>
<br><<AddItemToInventory $moltengolddew>>
<</if>>
<<elseif $regioneventid eq "reg_4">>
<<if $pe is 0>>
A monstrous figure blocks your path-a humanoid pig, tusks curling, bristling with muscle and raw energy.
Its gaze fixes on you like a predator sizing prey.
<!-- Demon Pig's Trial -->
<<if $demon_pig_encountered neq 1>>
<br><<link "Fight it" "NormalEvents">><<set $pe = 1>><</link>>
<br><<link "Offer food" "NormalEvents">><<set $pe = 2>><</link>>
<br><<link "Try to appease it" "NormalEvents">><<set $pe = 3>><</link>>
<<else>>
<<if $demon_pig_result eq "fight">>
The demon pig grunts, eyes narrowing as it recognizes you. It steps aside, acknowledging your strength.
<br><<link "Leave silently" $passage>><</link>>
<<elseif $demon_pig_result eq "food">>
The demon pig grunts in recognition, stepping aside to let you pass. It seems to remember your kindness.
<br><<link "Leave silently" $passage>><</link>>
<<elseif $demon_pig_result eq "appease">>
<br>It lunges before you can flee. Its tusks press into your shoulders as massive hands grip your hips.
<br><span class="male">"Did you miss me?"</span> its growl seems to echo in your mind. Its cock slams into your cunt before you can react, shoving you to the ground in doggy style.
<br>You gasp and whimper as it thrusts relentlessly, each grunt pounding your cunt harder than the last. Pain and pleasure collide, your body betraying your hesitation.
<br>Cum rushes hot, thick, helplessly from your pussy as the beast groans and fills you again.
<br><<set _random to random(1,3)>><<if _random eq 1>><img src="images/Sex/demonpig.webp" class="nsfw-glow"><<elseif _random eq 2>><img src="images/Sex/demonpig1.webp" class="nsfw-glow"><<elseif _random eq 3>><img src="images/Sex/demonpig2.webp" class="nsfw-glow"><<set $monsterSexCount += 1>><</if>>
<br>You've been slightly corrupted by demonic energy!
<br><<set $health -= 0.1*$basemaxhealth>>
<br><<startStatChanges>>
<br><<gainExp 50 150>>
<br><<gainStat "luck" "baseluck" 1 0 40 "Luck">>
<br><<gainStat "corruption" "corruption" 3 0 100 "Corruption">>
<br><<gainStat "PCdemonicreputation" "PCdemonicreputation" 1 3 999 "Demonic Reputation">>
<br><<gainStat "sexFame" "sexFame" 1 3 999 "Fame">>
<br><<showStatChanges>>
<br><<link "Leave" $passage>>
<<set $demon_pig_encountered to 1>>
<<set $demon_pig_result to "appease">>
<</link>>
<</if>>
<</if>>
<<elseif $pe eq 1>>
The pig charges with astonishing speed. Its tusks gleam with malevolent energy, and you clash, qi against brute muscle.
<br>Victory smells of sweat, blood… and sizzling pork.
<br>Demon pig runs away, badly wounded.
<br><<set $health -= 0.1*$basemaxhealth>>
<br><<startStatChanges>>
<br><<gainExp 250>>
<br><<gainStat "luck" "baseluck" 1 0 40 "Luck">>
<br><<showStatChanges>>
<br><<link "Leave" $passage>>
<<set $demon_pig_encountered to 1>>
<<set $demon_pig_result to "fight">>
<</link>>
<<elseif $pe eq 2>>
You offer a steamed bun with shaking hands.
<br>The pig snorts, eyes bright, and devours it. Its gaze softens for a moment, then it grunts, stepping aside.
<br><<startStatChanges>>
<br><<gainStat "insight" "baseinsight" 1 0 40 "Insight">>
<br><<gainStat "luck" "baseluck" 1 0 40 "Luck">>
<br><<gainExp 150 210>>
<br><<showStatChanges>>
<br><<link "Leave" $passage>>
<<set $demon_pig_encountered to 1>>
<<set $demon_pig_result to "food">>
<</link>>
<<elseif $pe eq 3>>
The pig stands before you, towering and impossibly muscular, its nostrils flaring as it studies you like prey.
A guttural growl rumbles from deep within its chest. You step back instinctively, but the beast's sheer weight and speed leave no room for evasion. Its hands close around your shoulders, shoving you forward.
<br>
<br>You stumble onto your hands and knees, the cold, damp forest floor pressing against your skin. The pig looms behind, tusks glinting, eyes burning with unrestrained hunger. Your protests are muffled by the raw force of its dominance; every movement it makes is deliberate, claiming, powerful.
<br>
<br>Before you can react, it presses its thick, muscled body against yours. Your legs wobble, trapped. Its snout nuzzles your neck, hot breath brushing your ear, and you feel it press its massive cock against your cunt.
<br><<linkreplace "Continue">>
<<set _random to random(1,3)>><<if _random eq 1>><img src="images/Sex/demonpig.webp" class="nsfw-glow"><<elseif _random eq 2>><img src="images/Sex/demonpig1.webp" class="nsfw-glow"><<elseif _random eq 3>><img src="images/Sex/demonpig2.webp" class="nsfw-glow"><</if>>
<br>Hands-calloused, strong, impossible-grip your hips, shoving you onto all fours. You gasp, but it doesn't stop. Each thrust drags your pussy across the dirt, every grunt from the beast vibrating through your cunt. You try to pull away, but its hold is relentless.
<br>Its rutting grows rougher, tusks grazing your shoulders, cock pounding your cunt with brutal force. You whimper, shiver, cry out, and hate how your cunt clenches around it anyway, soaking the earth.
<br>You are pushed into the ground, your back arching as it drives deep and fast. Its cum hits your cunt hard, thick and hot, leaving you trembling, soaked, gasping. Your own climax tears through you, helpless, overwhelmed, cunt quivering as it empties itself inside you.
<br>The Demon Pig finally steps back, snorting, leaving you bruised, sticky, cunt sore, trembling on the dirt. Humiliation mixes with heat as you clutch your ruined clothes and your quivering pussy, heart racing from the force of it.
<br>You've been slightly corrupted by demonic energy!
<br>
<<if $virginity eq 1>>
<<set $virginity = 0>>
<<set $virginityLost = "Demon Pig">><<set $monsterSexCount += 1>>
<br><span class="red">You lost your virginity to $virginityLost!</span>
<</if>>
<br><<set $health -= 0.1*$basemaxhealth>>
<br><<startStatChanges>>
<br><<gainExp 150 210>>
<br><<gainStat "luck" "baseluck" 1 0 40 "Luck">>
<br><<gainStat "corruption" "corruption" 3 0 40 "Corruption">>
<br><<gainStat "PCdemonicreputation" "PCdemonicreputation" 1 3 999 "Demonic Reputation">>
<br><<gainStat "sexFame" "sexFame" 1 3 999 "Fame">>
<br><<showStatChanges>>
<br><<link "Leave" $passage>>
<<set $demon_pig_encountered to 1>>
<<set $demon_pig_result to "appease">>
<</link>>
<</linkreplace>>
<</if>>
<<elseif $regioneventid eq "reg_5">>
<<if $pe is 0>>
A fox-woman emerges from the mist, her many tails swaying hypnotically. Her crimson eyes fix on you with ancient hunger, lips curling into a knowing smile. She wears silk robes that cling to her curves, and there's something intoxicating about her presence—old magic, predatory grace.
<br><span class="female">"Well, well... what do we have here?"</span> Her voice drips with amusement. <span class="female">"A cultivator, lost in my forest?"</span>
<!-- Fox-Woman's Encounter -->
<<if $fox_woman_encountered neq 1>>
<br><<link "Try to seduce her" "NormalEvents">><<set $pe = 1>><</link>>
<br><<link "Challenge her to combat" "NormalEvents">><<set $pe = 2>><</link>>
<br><<link "Refuse and leave" "NormalEvents">><<set $pe = 3>><</link>>
<<else>>
<<if $fox_woman_result eq "seduce">>
The fox-woman's eyes gleam with recognition and amusement. She circles you slowly, tails brushing against your skin.
<br><span class="female">"Come back for more, have we?"</span> Her laugh is musical, dangerous.
<br><<link "Leave silently" $passage>><</link>>
<<elseif $fox_woman_result eq "fight">>
The fox-woman's expression hardens as she recognizes you. Despite the scar on her arm, respect flickers in her eyes.
<br><span class="female">"You again. Still arrogant enough to challenge me?"</span>
<br><<link "Leave silently" $passage>><</link>>
<<elseif $fox_woman_result eq "refuse">>
The fox-woman watches you approach with contempt written across her perfect face.
<br><span class="female">"Still running away, I see."</span> She turns away, dismissing you entirely.
<br><<link "Leave silently" $passage>><</link>>
<</if>>
<</if>>
<<elseif $pe eq 1>>
You step forward, meeting her gaze directly. Your cultivation is strong enough—you might be able to match her energy.
<br><span class="female">"Interesting..."</span> she purrs, watching you approach. <span class="female">"I can taste your desire from here."</span>
<br>She closes the distance between you, her movements fluid as water. Before you can speak, her clawed hand traces your cheek, and you feel the weight of her ancient power pressing against your mind—seductive, intoxicating, almost suffocating.
<br><span class="female">"Let me show you what a thousand years of experience feels like,"</span> she whispers.
<br><<linkreplace "Continue">>
<<set _random to random(1,3)>><<if _random eq 1>><img src="images/Sex/foxwoman.webp" class="nsfw-glow"><<elseif _random eq 2>><img src="images/Sex/foxwoman1.webp" class="nsfw-glow"><<elseif _random eq 3>><img src="images/Sex/foxwoman2.webp" class="nsfw-glow"><</if>>
<br>She pushes you against a tree, silk robes falling away. Her tails wrap around your body, soft fur contrasting with the urgency of her touch. Your clothes tear as she pulls you close, her mouth finding your neck, her teeth grazing your skin just hard enough to hurt.
<br>Her fingers slip inside you with practiced precision. <span class="female">"So wet already..."</span> she coos mockingly. <span class="female">"I wonder how many times I can make you come before you beg me to stop."</span>
<br>You moan as she works you expertly, her centuries of experience evident in every touch. She positions herself between your legs, and you feel her cock—hard, pressing against your entrance. When she thrusts, it's with a mix of tenderness and raw power that leaves you gasping.
<br>Her tails stroke your body as she moves inside you, deeper, faster, hitting that spot that makes your vision blur. You orgasm around her, and she doesn't slow—she intensifies, chasing her own release with animalistic hunger.
<br>When she comes, it's with a sound that's almost a roar. Her cum fills you, hot and thick, and you climax again, your body trembling beneath her. She holds you close afterward, surprisingly gentle, kissing your forehead like a lover rather than a predator.
<br><span class="female">"You'll do nicely,"</span> she whispers. <span class="female">"Come find me again when you need reminding of what true pleasure feels like."</span>
<br>You've been corrupted by fox-spirit magic!
<br><<set $health += 0.05*$basemaxhealth>>
<br><<startStatChanges>>
<br><<gainExp 120 180>>
<br><<gainStat "depravity" "depravity" 2 0 100 "Depravity">>
<br><<gainStat "corruption" "corruption" 2 0 100 "Corruption">>
<br><<gainStat "charm" "basecharm" 1 0 40 "Charm">>
<br><<gainStat "sexFame" "sexFame" 2 3 999 "Sex Fame">>
<br><<showStatChanges>>
<br><<if $virginity eq 1>>
<<set $virginity = 0>>
<<set $virginityLost = "Fox-Woman">>
<<set $monsterSexCount += 1>>
<br><span class="red">You lost your virginity to the $virginityLost!</span>
<</if>>
<br><<link "Leave" $passage>>
<<set $fox_woman_encountered to 1>>
<<set $fox_woman_result to "seduce">>
<</link>>
<</linkreplace>>
<<elseif $pe eq 2>>
You narrow your eyes and assume a fighting stance. The fox-woman's expression shifts—surprise, then dark amusement.
<br><span class="female">"Oh, how delightful! A mortal dares challenge me?"</span> She laughs, a sound like silver bells mixed with a predator's growl.
<br>The battle is fierce. Her tails lash out like serpents, each one crackling with fox-fire. You dodge, counterattack, channel your Qi. For a moment, you think you might have her—but she's ancient, cunning, powerful beyond measure.
<br>In the end, you emerge victorious, though barely. She's wounded, breathing hard, eyes blazing with respect and fury.
<br><span class="female">"Well fought, little cultivator. Few have the spine to stand against me."</span> She retreats into the mist, leaving trails of silver-blue light.
<br><<set $health -= 0.15*$basemaxhealth>>
<br><<startStatChanges>>
<br><<gainExp 300>>
<br><<gainStat "martialArts" "basemartialArts" 2 0 40 "Martial Arts">>
<br><<gainStat "strength" "basestrength" 1 0 40 "Strength">>
<br><<gainStat "righteousFame" "righteousFame" 1 3 999 "Righteous Fame">>
<br><<showStatChanges>>
<br><<link "Leave" $passage>>
<<set $fox_woman_encountered to 1>>
<<set $fox_woman_result to "fight">>
<</link>>
<<elseif $pe eq 3>>
You take a step back, shaking your head firmly. <span class="player">"I have no business with you, spirit."</span>
<br>The fox-woman's expression darkens. Her tails snap like whips, and the air grows cold.
<br><span class="female">"Rejecting me? How... insulting."</span> Her voice drips with venom. <span class="female">"Very well. Run along, little cultivator. But know this—I don't forget those who slight me."</span>
<br>She turns away, dismissing you. You feel her ancient eyes boring into your back as you walk away, and a chill runs down your spine. You made an enemy today.
<br><<startStatChanges>>
<br><<gainExp 30>>
<br><<gainStat "luck" "baseluck" 1 0 40 "Luck">>
<br><<showStatChanges>>
<br><<link "Leave quickly" $passage>>
<<set $fox_woman_encountered to 1>>
<<set $fox_woman_result to "refuse">>
<</link>>
<</if>>
<<elseif $regioneventid eq "reg_6">>
<<if $pe eq 0>>
<!-- The Broken Bell Tower-->
At the edge of a forgotten temple stands a tower of splintered wood and rusted bronze.
The wind sighs through the cracks, and with every gust, the great bell groans-a ghost of a tone that once commanded armies of faith.
Carved on the foundation are the words: <b>"Let the faithful awaken; let the unworthy tremble."</b>
Dust dances in the half-light. You feel the weight of countless forgotten prayers pressing on your chest.
<br>[[Ring the bell->NormalEvents][$pe=1]]
<br>[[Climb the tower ->NormalEvents][$pe=2]]
<br><<link "Leave silently" $passage>><</link>>
<<elseif $pe eq 1>> <!-- Ring the bell -->
You grip the old rope. The bell groans as you pull-its hollow note vibrates through your bones, stirring echoes of ancient voices.
A shimmer spreads from the ground, coalescing into the shape of a spectral monk. His lips move, but no sound escapes-only the resonance of peace.
He bows once, and the air calms. Where he stood, a faint crystal hums with rhythm and clarity.
<br><<AddItemToInventory $brightmeridiancrystal>>
<br><<startStatChanges>>
<br><<gainStat "insight" "baseinsight" 1 0 40 "Insight">>
<br><<gainStat "PCrighteousreputation" "PCrighteousreputation" 1 0 999 "Righteous Reputation">>
<br><<showStatChanges>>
<br><<link "Step away from the tower" $passage>><</link>>
<<elseif $pe eq 2>> <!-- Climb the tower -->
You climb carefully; the wooden steps creak beneath your weight. Dust swirls in the dim light filtering through broken beams.
At the top, the bell's fracture gleams faintly under moonlight. Beneath it lies a set of folded prayer scrolls and a small pouch, sealed with dried wax.
Inside is a pinch of fine, silvery dust that glows when exposed to your breath- Meditation Dust, used by ancient cultivators to focus during breakthroughs.
<br><<AddItemToInventory $meditationdust>>
<br><<startStatChanges>>
<br><<gainStat "basewillpower" "basewillpower" 1 0 40 "Willpower">>
<br><<showStatChanges>>
<br><<link "Descend quietly" $passage>><</link>>
<</if>>
<<elseif $regioneventid eq "reg_7">>
<<if $pe eq 0>>
<!-- The Snake and the Egg-->
Deep in the marshlands, fog swirls over black water. A low hiss cuts through the reeds.
A colossal serpent coils protectively around a single, pulsing egg-its scales shimmer like living jade, its eyes bright with wary intelligence.
Each breath it takes steams the air. You feel a flicker of ancient qi-this creature is not merely a beast, but a guardian.
<br>[[Approach the serpent peacefully->NormalEvents][$pe=1]]
<br>[[Attempt to steal the egg->NormalEvents][$pe=2]]
<br>[[Watch from afar ->NormalEvents][$pe=3]]
<br><<link "Leave silently" $passage>><</link>>
<<elseif $pe eq 1>> <!-- Peaceful approach -->
You kneel and channel calm qi through your palms, lowering your head.
The serpent watches you closely, muscles tensed to strike-then relaxes slightly as your aura harmonizes with its own.
It flicks its tongue, tasting your sincerity. A low hum vibrates through the marsh, and it sheds a single scale before slithering away into the mist.
<br><<AddItemToInventory $serpentpulsesalve>>
<br><<startStatChanges>>
<br><<gainStat "insight" "baseinsight" 1 0 40 "Insight">>
<br><<gainStat "PCrighteousreputation" "PCrighteousreputation" 1 0 999 "Righteous Reputation">>
<br><<showStatChanges>>
<br><<link "Leave the marsh" $passage>><</link>>
<<elseif $pe eq 2>><!-- Attempt to steal the egg -->
You dart forward, qi blazing—a desperate gambit that echoes through the marsh like a struck bell. Your fingers close around the slick shell, still warm from the serpent's coils, and for just a moment you think you might succeed.
Then the world becomes sound and fury.
The serpent's roar splits the silence like a celestial blade through silk. It reverberates through your bones, through the very water beneath your feet. The creature's ancient eyes flash with an intelligence that transcends mere animal rage—this is the wrath of something that has guarded its young for centuries, perhaps longer.
It lashes out with preternatural speed. Fangs the length of daggers arc toward you, venom dripping from their tips like liquid jade turned toxic. You barely raise your defense, qi crystallizing into a shield, but the impact sends you skidding backward through the marsh water.
Fangs graze your arm—a shallow cut, but the venom is no mortal poison. It sears your veins like molten silver, burning its way up your shoulder. You grit your teeth against the pain and clutch the egg, stumbling toward the marsh's edge.
You manage to escape with the egg—but at a cost. The venom will linger for hours, a reminder of how close you came to being torn apart.
<br><<AddItemToInventory $serpentpulsesalve>>
<br><<set $health -= 0.15*$basemaxhealth>>
<br><<startStatChanges>>
<br><<gainStat "PCdemonicreputation" "PCdemonicreputation" 1 1 999 "Demonic Reputation">>
<br><<showStatChanges>>
<br><<link "Retreat, clutching your prize" $passage>><</link>>
<<elseif $pe eq 3>>
You linger in the shadows, studying the serpent's breathing pattern and the subtle pulse of the egg. The creature's chest rises and falls in a rhythm both hypnotic and ancient—each breath carries decades of patience, of maternal devotion older than the oldest mountain.
Something ancient hums here—a rhythm of life and tribulation that vibrates at a frequency the mortal ear cannot perceive, but your cultivation allows you to feel it. It is the song of survival, of sacrifice, of the primal force that drives all creatures to protect their young. You absorb what you can of its qi pattern before leaving, wiser but untouched, understanding the delicate balance between desire and restraint.
<br><<startStatChanges>>
<br><<gainStat "insight" "baseinsight" 1 0 44 "Insight">>
<br><<gainExp 100 150>>
<br><<showStatChanges>>
<br><<link "Withdraw from the marsh" $passage>><</link>>
<</if>>
<!-- Wounded Cultivator-->
<<elseif $regioneventid eq "reg_8">>
<<if $pe eq 0>>
<<CreateNPC001>>
A wounded cultivator lies slumped against a tree, blood seeping between his fingers as he clutches his side. His breath is shallow, his robes torn, but his eyes flicker open when you approach.
<<set $currentSceneNPC to clone(_npc)>>
<br>[[Go closer->NormalEvents][$pe=1]]
<br><<link "Leave" $passage>><</link>>
<<elseif $pe eq 1>>
You step closer, the smell of iron thick in the air. The cultivator's lips twitch into a faint smile despite his injuries.
<br><span class="male">"C…Cultivator… help me,"</span> he whispers. His voice is hoarse, but there's strength hidden beneath it.
<br><<linkreplace "Treat his wounds" "NormalEvents" >>
You kneel beside him, channeling a thread of spiritual energy into his wounds. The torn flesh knits slowly; his breathing steadies. He groans, body trembling under your touch.
<<set _lewdchance = random(1,100)>>
<<if _lewdchance <= 50>>
<br><span class="male">"You saved me,"</span> he murmurs, eyes closing for a moment in relief. <span class="male">"I won't forget this debt."</span>
<br>[[Continue->NormalEvents][$pe=3]]
<<else>>
<br>His lips curve into a sly grin, even as the pain fades. <span class="male">"Such soft hands… it feels good when you touch me like that."</span> His eyes roam over your figure, shameless even in his weakened state.
The wounded cultivator leans closer, his hand brushing your wrist. <span class="male">"Stay a little longer,"</span> he whispers. <span class="male">"Let me repay your kindness… in another way."</span>
Despite his condition, his intent is clear: his other hand has already slipped lower, fingers grazing the bulge beneath his robes.
<br>[[Scold him->NormalEvents][$pe=3]]
<br><<if $corruption gte 0>>[[Accept his offer->NormalEvents][$pe=2]]<</if>>
<</if>>
<</linkreplace>>
<<elseif $pe eq 2>>
You wrap your hand around his cock, surprised at the heat of him despite his injuries. Thick and heavy, it twitches against your palm as though his lust is stronger than his pain.
<br>The cultivator exhales sharply, his back hitting the rough bark of the tree. <span class="male">"Nnh-your hands… softer than silk,"</span> he groans, his voice trembling between exhaustion and desire. His hips roll weakly, urging you to stroke him harder.
<br>You start slow, dragging your palm along his shaft, feeling every vein pulse beneath your fingers. His cock grows harder with each stroke, precum beading at the tip and smearing slick trails across your knuckles. His hand shoots out, gripping your thigh as if to anchor himself in the haze of pleasure.
<br><span class="male">"Faster,"</span> he begs, panting. <span class="male">"Make me forget the pain…"</span>
<br>You tighten your grip, sliding your hand up and down, wrist twisting just enough to make him buck against you. His cock jerks in your fist, leaking more with each motion, the smell of arousal thick in the cool forest air. His groans rise in pitch, echoing faintly through the trees.
<br><img src="images/Sex/handjob2.webp" class="nsfw-glow">
<br><span class="male">"Spirits… you're draining me more than any battle,"</span> he mutters, his head rolling back. He tries to keep his composure, but each ragged gasp betrays his growing desperation.
<br>You milk him faster, your strokes firm and unrelenting until his whole body trembles. His cock pulses violently in your hand, and with a guttural moan he finally spills, hot streams of cum painting across his torn robes and dripping down his abdomen.
<br>He slumps back, sweat-damp hair clinging to his forehead. His chest rises and falls as he catches his breath, but even spent, a crooked grin spreads across his lips.
<br><span class="male">"You… hah… you've healed me and left me undone in another way. I won't forget the feel of those hands… ever."</span>
<br><<set $currentSceneNPC.hadSex to 1>>
<br><<startStatChanges>>
<br><<gainStat "corruption" "corruption" 2 2 100 "Corruption">>
<br><<gainStat "sexFame" "sexFame" 3 6 999 "Sex Fame">>
<br><<showStatChanges>>
<br><<link "Continue" "NormalEvents">><<set $pe to 3>><</link>>
<<elseif $pe eq 3>>
<<set _npc to $currentSceneNPC>>
The cultivator wipes his mouth, steadying himself. His gaze lingers on you.
<br>He bows his head slightly. <span class="male">"You have my thanks. If fate allows, we will meet again."</span>
<br><<link "Remember him" $passage>> <<AddNPCWithFamily _npc>> <</link>>
<br><<link "Forget him" $passage>><</link>>
<</if>>
<!-- Drunk Wanderer Event -->
<<elseif $regioneventid eq "reg_9">>
<<if $pe eq 0>>
A red-faced mortal stumbles down the road, clutching a cracked jug of wine. His steps sway dangerously, and when he notices you, his lips split into a lopsided grin.
<br><span class="male">"Ahh… a beauty on the road! Come, come-drink with me, share my warmth!"</span> His words slur, and his free hand already reaches out toward you.
<<if $EventAction eq null>>
<br><<link "Indulge him and drink" "NormalEvents">><<set $EventAction to "drink">><</link>>
<br><<link "Ignore him and walk past" "NormalEvents">><<set $EventAction to "ignore">><</link>>
<br><<link "Mock him in front of others" "NormalEvents">><<set $EventAction to "mock">><</link>>
<br><<link "Push him away harshly" "NormalEvents">><<set $EventAction to "push">><</link>>
<br><<if $corruption gte 5>><<link "Let him touch you" "NormalEvents">><<set $pe to 1>><<set $EventAction to "touch">><</link>><</if>>
<<elseif $EventAction eq "drink">>
You accept the jug. The wine is cheap and burns your throat, but the man laughs loudly, slapping his knee.
<br><span class="male">"Hah! You're better company than those village nags. Cultivator or not, you've got spirit!"</span>
<br>He soon stumbles off, humming a broken tune.
<br><<link "Continue with your journey" $passage>><<set $EventAction to null>><</link>>
<<elseif $EventAction eq "ignore">>
You step past without a word. He curses weakly behind you, but he's too drunk to follow.
<br><<link "Continue with your journey" $passage>><<set $EventAction to null>><</link>>
<<elseif $EventAction eq "mock">>
You smirk and say loudly, <span class="player">"Careful, old man, before you drown yourself in piss instead of wine."</span>
<br><<link "Continue with your journey" $passage>><<set $EventAction to null>><</link>>
<br>Nearby mortals laugh cruelly. The wanderer's face reddens with shame.
<<elseif $EventAction eq "push">>
He staggers closer, but you shove him hard. He falls on his ass in the dirt, clutching his wine like it's his child.
<br><span class="male">"Ungrateful witch!"</span> he slurs, spitting on the ground.
<br><<link "Continue with your journey" $passage>><<set $EventAction to null>><</link>>
<</if>>
<<elseif $pe eq 1>>
You don't stop him when his hand grazes your waist. The drunkard chuckles, pressing closer, his breath hot with wine.
<br><span class="male">"Such soft skin… hah, a goddess come down to walk with mortals. Let me… taste you."</span>
<br>You allow his rough, wine-stained hands to paw at your body. His palm cups your breast clumsily through your robes, squeezing as if you were nothing more than a tavern wench.
<br><img src="images/Sex/titgrab.webp" class="nsfw-glow">
<br><span class="male">"Heh… so soft… even immortals feel like women in the end…"</span> he mutters, grinding against you.
<br>His cock is already hard under his filthy trousers, straining against the fabric.
<br>Your hand slides down, tugging at his filthy trousers. His cock springs free, thick and already slick at the tip.
<br>The drunk groans in disbelief, <span class="male">"Ahh… gods above… a fairy touching my cock…"</span> His voice trembles between awe and filth.
<br>You stroke him firmly, your fingers curling around his shaft. His hips jerk helplessly, chasing your hand with drunken desperation.
<br><span class="male">"Faster… don't stop… ahh, fuck-"</span>
<br><img src="images/Sex/handjob1.webp" class="nsfw-glow">
<br>He moans like an animal, seed spilling messily across his own chest and belly. He sags against you, panting and laughing at once.
<br><span class="male">"Hah… hah… blessed by heaven itself…"</span>
<br><<startStatChanges>>
<br><<gainStat "sexFame" "sexFame" 1 3 999 "Sex Fame">>
<br><<gainStat "PCdemonicreputation" "PCdemonicreputation" 1 3 999 "Demonic Reputation">>
<br><<gainStat "corruption" "corruption" 1 3 100 "Corruption">>
<br><<showStatChanges>>
<br><<link "Continue with your journey" $passage>><<set $EventAction to null>><</link>>
<</if>>
<!-- Peasant Wedding -->
<<elseif $regioneventid eq "reg_10">>
<<if $pe eq 0>>
Lanterns swing gently from wooden poles, their glow casting warm light over a village square. The silk they're made from shimmers with a faint, enchanted luminescence—someone spent coin for quality.
Laughter and music fill the night: a peasant wedding feast in full swing. Musicians strum traditional instruments with practiced fingers, and the melody carries the warmth of a thousand such celebrations. Red banners ripple in the evening wind, embroidered with symbols of prosperity and union, fluttering like the wings of phoenix birds in miniature. Mortals cheer with joy around simple wooden tables laden with roasted meats, steamed vegetables, and ceramic vessels of rice wine.
The aroma of incense mingles with food—sandalwood and jasmine, a touch of luxury that speaks of careful preparation. Even peasants know how to honor an occasion.
Several eyes turn toward you as you approach. The cut of your robes speaks of cultivation rank; the faint aura of Qi around you hums like a tuning fork striking a note mortals feel in their bones. A cultivator is no common guest here. Whispers ripple through the crowd—not fearful, but reverent, tinged with hope that perhaps the heavens themselves have blessed this union.
<br><<link "Approach the feast" "NormalEvents">><<set $pe to 1>><</link>>
<br><<link "Leave" $passage>><</link>>
<<elseif $pe eq 1>>
A long wooden table is crowded with steaming dishes and rice wine, their scents mingling in the warm night air. The villagers bow deeply, making space for you with movements so synchronized they seem almost choreographed. An elder steps forward, his face weathered by decades of tending fields under sun and moon. His eyes, however, are sharp and aware—he understands the weight of a cultivator's presence.
An elder bows low, his movement reverent yet practiced.
<br><span class="male">"Honored Immortal, your presence blesses this humble union. The bride and groom are blessed beyond measure to have caught the attention of one who walks the higher paths. Please, grace us with your presence at our feast. We have prepared what our humble means allow."</span>
His voice carries the accent of the provincial towns, but his sincerity is unmistakable. Around him, the crowd watches with bated breath—will you honor them or scorn them?
<br><<link "Join them politely" "NormalEvents">><<set $pe to 3>><</link>>
<br><<link "Decline with cold pride" $passage>><</link>>
<br><<link "Cause trouble" "NormalEvents">><<set $pe to 2>><</link>>
<<elseif $pe eq 2>>
You sneer at their meager offerings, letting your gaze sweep across the tables with deliberate disdain. Your aura flares—just slightly, enough to make the mortal Qi in the air recoil like a frightened animal.
<span class="player">"This wine is weak swill. These dishes are fit only for pigs, not for one who has tasted the essence of celestial fruits and cultivated spiritual wine. Your efforts are... quaint. Pathetic, even."</span>
The crowd trembles; some glare with suppressed anger, but none dare speak. One young man's fists clench, but his elder restrains him with a single look. Children cry softly as the elder bows repeatedly, begging you not to ruin the day—as if your presence, uninvited, already hasn't cast a shadow across their joy.
Your words sink into their hearts like stones into still water. They will remember this night, and they will remember your cruelty.
<br><<startStatChanges>>
<br><<gainStat "PCdemonicreputation" "PCdemonicreputation" 1 3 999 "Demonic Reputation">>
<br><<showStatChanges>>
<br><<link "Continue with your journey" $passage>><</link>>
<<elseif $pe eq 3>>
You settle among them with deliberate grace. The mortals pour rice wine into your cup with shaking hands—some from reverence, some from fear—watching your every movement as if you might suddenly transform into something otherworldly. Which, of course, you are.
Children sneak glances at you from behind their parents' robes, as if staring too long might blind them or draw divine lightning down upon their heads. One brave little girl, no more than five years old, reaches out to touch the hem of your sleeve before her mother yanks her back with an apologetic bow.
The feast drags into the night, laughter mixing with the crackle of torches, but it's a laughter tinged with nervousness. Your presence has transformed the celebration into something else—not quite fear, not quite reverence, but something in between. The wine tastes sweeter on their lips knowing a cultivator shares their table.
<<set _nsfwchance = random(1,100)>>
<br><<linkreplace "Offer a gift to the couple" "NormalEvents">>
<br><<startStatChanges>>
<br><<gainStat "PCrighteousreputation" "PCrighteousreputation" 1 3 999 "Righteous Reputation">>
<br><<showStatChanges>>
You produce a small pouch of spirit stones from your storage ring—nothing extravagant by cultivator standards, but worth more than this village earns in a year. The crowd gasps as if you've just revealed a cache of celestial jade.
<br><span class="player"> "Blessings upon your union. May your bloodline carry fortune for ten generations. May your descendants walk higher paths than you have walked."</span> Your voice carries the weight of genuine benediction, and for a moment, your aura flares bright enough to cast shadows dancing across the feast.
The elder kneels, tears streaming down his weathered face. Your magnanimity will be remembered—songs may even be sung about this night in the village square for years to come.
<</linkreplace>>
<br><<linkreplace "Stay silent, enjoy food" "NormalEvents">>
The wedding fades behind you as you step back onto the road. Mortals return to their joy, unaware—or willfully blind—to what transpired beneath the moonlight. Your presence becomes a memory, a story they'll tell with wonder and uncertainty about whether it truly happened or if it was a collective dream sent by benevolent spirits.
<br><<link "Continue with your journey" $passage>><</link>>
<</linkreplace>>
<<if _nsfwchance <= 40>>
<br><<link "Later in the night…" "NormalEvents">><<set $pe to 4>><</link>>
<</if>>
<<elseif $pe eq 4>>
<<set _brideorgroom = random(1,2)>>
<<if _brideorgroom == 1>>
<!-- Bride variant -->
The young bride, cheeks flushed from too much wine, grasps your sleeve.
<br>Her wedding veil hangs loose, eyes glazed but yearning.
<br><span class="female">"Immortal… before I give myself to a mortal man, grant me a blessing. Let me taste divinity, if only once…"</span>
<br><<link "Indulge her" "NormalEvents">><<set $pe to 5>><</link>>
<br>[[Gently refuse->$passage]]
<<else>>
The groom, staggering and drunk, collapses to his knees before you.
<br>His eyes are wild with awe and wine.
<br><span class="male">"Great one…! Share your power with me tonight-let me *truly* honor this marriage bed." </span>
<br><<link "Indulge him" "NormalEvents">><<set $pe to 6>><</link>>
<br>[[Shove him aside->$passage]]
<</if>>
<<elseif $pe eq 5>>
With a swift movement, you push her gently onto the soft grass behind the feast hall. Lantern light flickers across her face, wide eyes, lips parted, breath hitching.
<br><span class="player">"On your knees,"</span> you order, your hand gripping her hair lightly, tilting her head toward your waiting fingers.
<br>She obeys immediately, hands clutching your thighs, eyes locked on yours as you slowly slide a finger into her wet cunt, teasing her. She gasps, shivering as your finger probes deeper.
<br><span class="player">"Gods… you're so tight… my little mortal slut,"</span> you murmur, circling her clit with your thumb, watching her moan.
<br>Her hands slide over your robes, tugging at them, desperate to feel your skin. You press your palm against her mouth, smirking.
<br><span class="player">"No touching yet… you'll learn to obey,"</span> you whisper, thrusting two fingers inside her cunt. She moans loudly, hips jerking toward you.
<br><<linkreplace "Continue">>
<br><img src="images/Sex/lesbian.webp" class="nsfw-glow">
<br><span class="female">"Yes… yes, Mistress… please…",</span> she gasps, voice trembling. You push her onto her back, straddling her, grinding your cunt against hers. She bites her lip, whimpering as your wet pussy presses into hers.
<br>You lean down, gripping her chin, forcing her eyes to meet yours.
<br><span class="player">"You're mine tonight," </span> you growl, slipping a finger into her mouth while thrusting against her with your pussy. She sucks greedily, trying to taste the nectar of your arousal.
<br>Her hands roam over your hips and breasts, tugging, kneading, desperate for more. You push her wrists above her head, smirking at her helplessness.
<br><span class="player">"Beg me to fuck you with my fingers… beg for it, slut,"</span> you demand. She gasps, trembling,
<br><span class="female">"Please… fuck me… make me cum, Mistress…"</span>
<br>You plunge your fingers into her cunt, curling them expertly, watching her shudder, hips bucking. Her juices mix with yours, slick and dripping, painting the grass beneath you.
<br><span class="player">"Cum for me, little mortal… cum all over my fingers,"</span> you command. Her back arches, scream muffled against your hand, body trembling as she spills her first orgasm.
<br>Not done yet, you grind your wet pussy against hers again, pressing her face into your chest, forcing her to taste your arousal. She moans around your nipple, writhing under your control.
<br><<startStatChanges>>
<br><<gainStat "sexFame" "sexFame" 1 5 999 "Sex Fame">>
<br><<gainStat "PCdemonicreputation" "PCdemonicreputation" 1 4 999 "Demonic Reputation">>
<br><<gainStat "corruption" "corruption" 1 3 100 "Corruption">>
<br><<showStatChanges>>
<br><<link "Continue with your journey!" $passage>><</link>>
<</linkreplace>>
<<elseif $pe eq 6>>
The groom's eyes blaze with drunken lust as he shoves you against the side of the tavern wall. His hands grip your shoulders, forcing you to look at him.
<br><span class="male">"I'm going to taste you… you're mine tonight, immortal,"</span> he growls, fingers digging into your arms.
<br>You try to pull away, but he shoves your robes open, exposing your soft, pale skin. His cock throbs visibly through his trousers, slick with arousal.
<br><span class="male">"Beg me… beg me to fuck your cunt,"</span> he snarls, shoving you down onto your knees.
<br><img src="images/Sex/sideBlowjob.webp" class="nsfw-glow">
<br>Your breath catches, cheeks flushing, and your fingers clutch at his belt. His hands shove your head down toward his cock. You swallow around it, trembling as his length presses against your lips, hot and heavy.
<br><span class="male">"Lick it, whore… show me you're worthy,"</span> he growls.
<br>You obey, lips sliding down his cock as he groans, gripping your hair roughly. The taste of sweat and wine mixes with his pre-cum, slicking your lips and dripping onto your tongue. Every suck, every lick draws a sharp, guttural groan from him, and he thrusts into your mouth, forcing you deeper.
<br><<linkreplace "Continue">>
<br><span class="male">"Goddamn… your little cunt is going to taste every drop of my cum,"</span> he snarls, jerking his cock violently in your throat. You gag, choke, and moan around him, the sound lost under his heavy breathing.
<br><img src="images/Sex/pb.webp" class="nsfw-glow">
<br>He shoves you onto the floor, straddling your chest roughly. His cock presses against your pussy, wet and needy. He thrusts hard, groaning as your cunt spreads around him, the tight warmth gripping him.
<br><span class="male">"So fucking tight… you like being my little slut, don't you?"</span> he pants.
<br>You whimper, nodding submissively, hands clutching at his arms as he slams into you over and over. His hips smash against yours, cock plunging deep, messy with your slick. You moan and whine, cunt dripping, body trembling under his violent thrusts.
<br><span class="male">"Fuck… cum for me, cunt… I'll fill you with my sperm,"</span> he growls, grabbing your hair and forcing your head back as he shoves his cock in deeper. His hands roam over your body, pinching your nipples, squeezing your ass, leaving bruises as he fucks you ruthlessly.
<br>Your body shakes, pussy clenching around him, and you cry out as your orgasm hits, slick spilling down your thighs. He doesn't let up, fucking you through your climax, shoving his cum deep into your cunt until you're nothing but a messy, trembling heap under him.
<br>Finally spent, he collapses atop you, breathing heavily, sweat mixing with your own. Your hair is mussed, robes torn, cunt soaked with his cum.
<<if $virginity eq 1>>
<<set $virginity = 0>>
<<set $virginityLost = "random groom">>
<br><span class="red">You lost your virginity to $virginityLost!</span>
<<set $humanSexCount += 1>>
<</if>>
<br><<startStatChanges>>
<br><<gainStat "sexFame" "sexFame" 1 5 999 "Sex Fame">>
<br><<gainStat "PCdemonicreputation" "PCdemonicreputation" 1 4 999 "Demonic Reputation">>
<br><<gainStat "corruption" "corruption" 1 3 100 "Corruption">>
<br><<showStatChanges>>
<br><<link "Continue with your journey!" $passage>><</link>>
<</linkreplace>>
<</if>>
<!-- ════════════════════════════════════════════════════
Wandering Merchant Troupe · reg_13
════════════════════════════════════════════════════ -->
<<elseif $regioneventid eq "reg_13">>
<<MerchantTroupeWidget>>
<</if>>
<<if $randomeventid eq 14>>
EMPTY THO
<</if>>/* ─────────────────────────────────────────────
SECT_1 — Senior disciple blocking your path
───────────────────────────────────────────── */
<<if $regioneventid is "sect_1">>
<<set _disciple to {name: "Senior Brother Fang Lie", rank: "Inner Disciple"}>>
<p>He looks you over slowly — not with hostility, but with the quiet confidence of someone who has never had to hurry. His sect robes are immaculate. The embroidered crest on his chest marks him two full ranks above you.</p>
<p>"You've been wandering the outer paths alone," he says. It isn't a question. "A woman of your… cultivation travelling unescorted." A pause. "Interesting."</p>
<<if $CurrentPcSectRank is "Initiate" or $CurrentPcSectRank is "Disciple">>
<p>His tone is cordial, but the hierarchy between you is impossible to ignore. An Initiate challenging a senior directly would be noted — and remembered.</p>
<<elseif $CurrentPcSectRank is "Inner Disciple">>
<p>You are his equal in rank. That makes this conversation different. He knows it too.</p>
<<elseif $CurrentPcSectRank is "Core Disciple" or $CurrentPcSectRank is "True Disciple" or $CurrentPcSectRank is "Elder">>
<p>His posture shifts almost imperceptibly as he registers your rank. Whatever he intended, he is recalculating.</p>
<</if>>
<div id="event-choices">
<<link "Stand your ground — meet his gaze without flinching">>
<<replace "#event-choices">>
<p>You hold his stare. A long moment passes. Something flickers at the corner of his mouth — not mockery, but recognition. He uncrosses his arms.</p>
<p>"Good." He steps aside and gestures along the path. "Disciples who flinch don't last in the outer territories." He falls into step beside you, uninvited. "I'll walk with you awhile. Consider it… courtesy."</p>
<p>He does not touch you. He does not need to. The weight of his attention is its own kind of pressure.</p>
<<startStatChanges>>
<<gainStat "PCrighteousreputation" "PCrighteousreputation" 2 0 999 "Righteous reputation">>
<<showStatChanges>>
<p>[[Continue your patrol|Map|Region1]]</p>
<</replace>>
<</link>>
<br>
<<link "Lower your eyes — play the obedient junior disciple">>
<<replace "#event-choices">>
<p>You drop your gaze and fold your hands. The performance is perfect.</p>
<p>He steps closer. You can feel him studying you — the curve of your neck, the way your breath has slowed. "Much better," he murmurs. His fingers brush your chin, tilting your face up anyway. "No point in hiding such a pretty thing."</p>
<p>He holds your face there for a breath longer than is appropriate, then releases you and steps back with a satisfied smile.</p>
<p>"You may pass, junior sister. I'll be watching your progress."</p>
<<startStatChanges>>
<<gainStat "PCdemonicreputation" "PCdemonicreputation" 1 0 999 "Demonic Reputation">>
<<loseStat "PCrighteousreputation" "PCrighteousreputation" 1 0 999 "Righteous Reputation">>
<<showStatChanges>>
<p>[[Continue your patrol|Map|Region1]]</p>
<</replace>>
<</link>>
<br>
<<if $corruption gte 30>>
<<link "Press him — suggest he owes you something for blocking your path">>
<<replace "#event-choices">>
<p>You smile and let the silence stretch. "You stopped me, Senior Brother. That cost me time." You tilt your head. "I wonder what you intend to do about that."</p>
<p>The surprise on his face is brief. Then — satisfyingly — it melts into something warmer. He steps in close, voice dropping low.</p>
<p>"Bold little thing." His hand finds your waist, testing. When you don't pull away, he pulls you closer. "I can think of a few ways to make it up to you."</p>
<p>What follows is not gentle. But you asked for that.</p>
<<startStatChanges>>
<<gainStat "corruption" "corruption" 2 0 100 "Corruption">>
<<gainStat "PCdemonicreputation" "PCdemonicreputation" 3 0 999 "Demonic Reputation">>
<<showStatChanges>>
<p>[[Continue your patrol|Map|Region1]]</p>
<</replace>>
<</link>>
<br>
<</if>>
<<link "Challenge him to a sparring match — let cultivation speak">>
<<replace "#event-choices">>
<p>"If you want to assess me," you say evenly, "spar with me."</p>
<p>His eyebrows rise. Then he laughs — a real one. He rolls his shoulder and shifts into a stance.</p>
<p>"Now that is the right answer."</p>
<p>The match is brief and instructive. He is better than you expected, but you hold your own. When it ends, he clasps his hands and gives a small, genuine bow.</p>
<p>"You'll go far, junior sister." He sounds like he means it.</p>
<<startStatChanges>>
<<gainStat "PCrighteousreputation" "PCrighteousreputation" 3 0 999 "Righteous reputation">>
<<showStatChanges>>
<p>[[Continue your patrol|Map|Region1]]</p>
<</replace>>
<</link>>
</div>
/* ─────────────────────────────────────────────
SECT_2 — Rogue cultivator wanting blood
───────────────────────────────────────────── */
<<elseif $regioneventid is "sect_2">>
<<set _rogue to {name: "Hollow Fang cultivator"}>>
<p>He emerges fully now — ragged robes, qi scarred and jagged from years outside any sect structure. His eyes are hungry. Not for your cultivation resources. For the kill itself.</p>
<p>"I've cut down three sect dogs this season," he says conversationally, drawing a thin blade. "You'll make four. I collect the cores." He smiles. "The women I collect differently."</p>
<div id="event-choices">
<<link "Draw your weapon — end this quickly">>
<<replace "#event-choices">>
<p>You don't answer. You move.</p>
<p>He's fast — rogue cultivators always are, they have nothing to lose. But his qi is fractured and undisciplined. You find the gap in his form and press it.</p>
<p>When it's over, he's on his knees in the dirt, blade gone, breathing hard. You hold the point of your weapon to his throat.</p>
<p>"Four," he manages.</p>
<p>"Try five." You step back and let him run. He takes it.</p>
<<startStatChanges>>
<<gainStat "PCrighteousreputation" "PCrighteousreputation" 2 0 999 "Righteous reputation">>
<<showStatChanges>>
<p>[[Continue your patrol|Map|Region1]]</p>
<</replace>>
<</link>>
<br>
<<link "Negotiate — offer him sect resources in exchange for leaving">>
<<replace "#event-choices">>
<p>"You want resources," you say. "Cores, spirit stones. Not a fight."</p>
<p>He tilts his head. Suspicious, but listening.</p>
<p>You keep your hands visible and your voice even as you name a price. It costs you some of what you've gathered today, but he sheathes the blade and spits to the side.</p>
<p>"Smart girl." He pockets the stones and fades back into the tree line.</p>
<<startStatChanges>>
<<gainStat "PCdemonicreputation" "PCdemonicreputation" 2 0 999 "Demonic Reputation">>
<<loseStat "PCrighteousreputation" "PCrighteousreputation" 1 0 999 "Righteous Reputation">>
<<showStatChanges>>
<p>You lose some spirit stones.</p>
<<set $spirit_stones -= 5>>
<p>[[Continue your patrol|Map|Region1]]</p>
<</replace>>
<</link>>
<br>
<<if $corruption gte 40>>
<<link "Let him approach — turn this on its head">>
<<replace "#event-choices">>
<p>You sheathe your weapon.</p>
<p>He blinks. Stops. The hunger in his eyes shifts shape as you step toward him instead.</p>
<p>"You said women differently," you say. "Show me what you meant."</p>
<p>Whatever he intended to take by force, he suddenly finds offered freely — and that breaks him more completely than any blade would have. He is rougher than a sect cultivator, and you allow it, and somewhere in the middle of it his hands stop shaking and he forgets entirely that he wanted to kill you.</p>
<p>Afterward, he sits in the dirt and stares at you with something like awe.</p>
<p>"What sect are you?" he asks.</p>
<p>You don't answer. You straighten your robes and walk past him.</p>
<<startStatChanges>>
<<gainStat "corruption" "corruption" 3 0 120 "Corruption">>
<<gainStat "PCdemonicreputation" "PCdemonicreputation" 4 0 999 "Demonic Reputation">>
<<showStatChanges>>
<p>[[Continue your patrol|Map|Region1]]</p>
<</replace>>
<</link>>
<br>
<</if>>
<<link "Use your sect rank — warn him of the consequences">>
<<replace "#event-choices">>
<p>You name your sect clearly and let the weight of it land. A <<print $CurrentPcSectRank>> of the sect does not disappear quietly. The investigation would follow.</p>
<p>He weighs it. You can see him doing it — calculating how much trouble a body brings. His jaw tightens.</p>
<p>"Next time," he says, and vanishes into the undergrowth.</p>
<<startStatChanges>>
<<gainStat "PCrighteousreputation" "PCrighteousreputation" 1 0 999 "Righteous reputation">>
<<showStatChanges>>
<p>[[Continue your patrol|Map|Region1]]</p>
<</replace>>
<</link>>
</div>
/* ─────────────────────────────────────────────
SECT_3 — Sect members plotting betrayal
───────────────────────────────────────────── */
<<elseif $regioneventid is "sect_3">>
<p>You go still. Through the brush, you make out three disciples — outer robes, familiar crests. Their voices are low but your cultivation is sharper than they expect.</p>
<p>Names. A meeting point. A price. Someone from an enemy sect is paying for information about the inner sanctum's patrol schedule — and at least one of these three has already agreed to sell it.</p>
<p>They haven't noticed you yet.</p>
<div id="event-choices">
<<link "Confront them directly">>
<<replace "#event-choices">>
<p>You step out of the undergrowth.</p>
<p>The three of them spin. One reaches for a weapon. You let your qi flare once — just enough — and the arm freezes.</p>
<p>"<<print $CurrentPcSectRank>>," you say. "Whatever you've agreed to, unmake it. Now. And then you'll come with me to the Elder Hall."</p>
<p>Two of them fold immediately. The third runs. You let him. He'll be found.</p>
<<startStatChanges>>
<<gainStat "PCrighteousreputation" "PCrighteousreputation" 5 0 999 "Righteous reputation">>
<<loseStat "PCdemonicreputation" "PCdemonicreputation" 2 0 999 "Demonic Reputation">>
<<showStatChanges>>
<p>[[Continue your patrol|Map|Region1]]</p>
<</replace>>
<</link>>
<br>
<<link "Withdraw silently — report it to your sect leadership">>
<<set $PCrighteousreputation += 3>>
<<replace "#event-choices">>
<p>You pull back without a sound. Better to let them finish the conversation — you want names, a timeline, specifics. You commit every word to memory.</p>
<p>By nightfall you've delivered a full account to a sect elder. The disciples are detained before dawn.</p>
<p>The elder looks at you with quiet approval. "Good judgment, <<print $CurrentPcSectRank>>."</p>
<<startStatChanges>>
<<gainStat "PCrighteousreputation" "PCrighteousreputation" 3 0 999 "Righteous reputation">>
<<showStatChanges>>
<p>[[Continue your patrol|Map|Region1]]</p>
<</replace>>
<</link>>
<br>
<<if $PCdemonicreputation gte 20>>
<<link "Approach them — offer to cut yourself in">>
<<replace "#event-choices">>
<p>You step into their circle before they can scatter, hands loose, expression easy.</p>
<p>"Whatever they're paying," you say, "I can open doors you can't."</p>
<p>Silence. One of them starts to protest. Another grabs his arm.</p>
<p>"She's a <<print $CurrentPcSectRank>>," he mutters. "Think about what access she has."</p>
<p>The negotiation is quick and cold. You walk away with a share of the payment and a future contact outside the sect — and three traitors who are now, technically, loyal to you.</p>
<<startStatChanges>>
<<gainStat "corruption" "corruption" 2 0 100 "Corruption">>
<<gainStat "PCdemonicreputation" "PCdemonicreputation" 5 0 999 "Demonic Reputation">>
<<loseStat "PCrighteousreputation" "PCrighteousreputation" 3 0 999 "Righteous Reputation">>
<<showStatChanges>>
<p>[[Continue your patrol|Map|Region1]]</p>
<</replace>>
<</link>>
<br>
<</if>>
<<if $corruption gte 35>>
<<link "Use what you've heard as leverage — blackmail them privately">>
<<replace "#event-choices">>
<p>You wait until the three of them separate. Then you find the one who looked most frightened — the follower, not the ringleader — and you step onto his path.</p>
<p>He pales when he realises you were there. Were listening. Have been, for a while.</p>
<p>You don't raise your voice. You don't have to. You name your terms quietly: silence, in exchange for services rendered — and rendered well.</p>
<p>He agrees. He has no choice and he knows it. The fear in his face shifts into something else as you make the nature of the arrangement clear. Not entirely unwilling. Just cornered.</p>
<<startStatChanges>>
<<gainStat "corruption" "corruption" 2 0 100 "Corruption">>
<<gainStat "PCdemonicreputation" "PCdemonicreputation" 4 0 999 "Demonic Reputation">>
<<showStatChanges>>
<p>[[Continue your patrol|Map|Region1]]</p>
<</replace>>
<</link>>
<br>
<</if>>
</div>
<</if>><<widget "RichQiPlace_Region1">>
<b>You've stumbled upon a place brimming with rich spiritual energy! The air is thick with qi.</b>
The density of spiritual energy here is extraordinary — a place perfect for cultivation.
Do you want to cultivate?
<<link "Yes" "QiCultivation_Region1">><</link>>
<</widget>>
<<widget "RareHerbs_Region1">>
<b>While traveling, you stumble upon a patch of rare herbs growing beside the path. Their scent is rich, almost intoxicating.</b>
Their subtle fragrance suggests strong medicinal properties.
Do you want to gather them?
<<link "Yes" "RareHerbs_Region1">><</link>>
<</widget>>
<<widget "HerbFinder">>
<<for _i to 0; _i lt $playeriteminventory.length; _i++>>
<
<</for>>
<</widget>><<widget "RegionEvents">>
<<if not $regionEvent.active>>
<!-- safety: nothing to show -->
<<else>>
<<set _id = $regionEvent.id>>
<<if $regionEvent.active and $playerX is $regionEvent.x and $playerY is $regionEvent.y>>
<<if _id is "reg_1">>
<<set $regioneventid to "reg_1">>
<p>The grove is hushed, save for the sigh of bamboo swaying like an endless sea. Yet beneath the rustle, whispers slither - too deliberate to be mere wind.</p>
<<link "Approach">>
<<set $regionEvent.active = false>>
<<goto "NormalEvents">>
<</link>>
<<elseif _id is "reg_2">>
<<set $regioneventid to "reg_2">>
<p>A lotus blooms in the middle of a bloodied pond. Its petals shimmer like fresh wounds.</p>
<<link "Approach">>
<<set $regionEvent.active = false>>
<<goto "NormalEvents">>
<</link>>
<<elseif _id is "reg_3">>
<<set $regioneventid to "reg_3">>
<p>You find a cracked jug half-buried in earth. A heavenly fragrance leaks from within.</p>
<<link "Approach">>
<<set $regionEvent.active = false>>
<<goto "NormalEvents">>
<</link>>
<<elseif _id is "reg_4">>
<<set $regioneventid to "reg_4">>
<p>A monstrous humanoid pig blocks your path, tusks gleaming.</p>
<<link "Approach">>
<<set $regionEvent.active = false>>
<<goto "NormalEvents">>
<</link>>
<<elseif _id is "reg_5">>
<<set $regioneventid to "reg_5">>
<p>A fox-woman dances in the mist, her many tails swaying hypnotically.</p>
<<link "Approach">>
<<set $regionEvent.active = false>>
<<goto "NormalEvents">>
<</link>>
<<elseif _id is "reg_6">>
<<set $regioneventid to "reg_6">>
<p>A broken bell tower groans in the wind, its echo haunting the land.</p>
<<link "Approach">>
<<set $regionEvent.active = false>>
<<goto "NormalEvents">>
<</link>>
<<elseif _id is "reg_7">>
<<set $regioneventid to "reg_7">>
<p>A massive serpent coils around a glowing egg, watching you carefully.</p>
<<link "Approach">>
<<set $regionEvent.active = false>>
<<goto "NormalEvents">>
<</link>>
<<elseif _id is "reg_8">>
<<set $regioneventid to "reg_8">>
<p>A wounded cultivator leans against a tree, barely breathing.</p>
<<link "Approach">>
<<set $regionEvent.active = false>>
<<goto "NormalEvents">>
<</link>>
<<elseif _id is "reg_9">>
<<set $regioneventid to "reg_9">>
<p>A drunk wanderer staggers toward you, grinning foolishly.</p>
<<link "Approach">>
<<set $regionEvent.active = false>>
<<goto "NormalEvents">>
<</link>>
<<elseif _id is "reg_10">>
<<set $regioneventid to "reg_10">>
<p>A lively mortal wedding fills the area with laughter and lantern light.</p>
<<link "Approach">>
<<set $regionEvent.active = false>>
<<goto "NormalEvents">>
<</link>>
<<elseif _id is "reg_11">>
<<set $regioneventid to "reg_11">>
<p>You discover glowing herbs rich with concentrated qi.</p>
<<link "Approach">>
<<set $regionEvent.active = false>>
<<goto "RareHerbs_Region1">>
<</link>>
<<elseif _id is "reg_12">>
<<set $regioneventid to "reg_12">>
<p>A peaceful clearing filled with dense qi invites meditation.</p>
<<link "Approach">>
<<set $regionEvent.active = false>>
<<goto "QiCultivation_Region1">>
<</link>>
<<elseif _id is "reg_13">>
<<set $regioneventid to "reg_13">>
<p>A merchant caravan has set camp, filled with exotic goods.</p>
<<link "Approach">>
<<set $regionEvent.active = false>>
<<goto "NormalEvents">>
<</link>>
/* === SECT EVENTS === */
<<elseif _id is "sect_1">>
<<set $regioneventid to "sect_1">>
<p>A senior disciple from your sect blocks your path, arms folded. His gaze is sharp, evaluating.</p>
<<link "Approach">>
<<set $regionEvent.active = false>>
<<goto "NormalSectEvents">>
<</link>>
<<elseif _id is "sect_2">>
<<set $regioneventid to "sect_2">>
<p>A rogue cultivator steps from the shadows. "A sect dog… perfect prey."</p>
<<link "Approach">>
<<set $regionEvent.active = false>>
<<goto "NormalSectEvents">>
<</link>>
<<elseif _id is "sect_3">>
<<set $regioneventid to "sect_3">>
<p>You overhear whispers — sect members plotting betrayal.</p>
<<link "Approach">>
<<set $regionEvent.active = false>>
<<goto "NormalSectEvents">>
<</link>>
<<else>>
<p>Something feels wrong… (invalid event)</p>
<<set $regionEvent.active = false>>
<</if>>
<</if>>
<</if>>
<</widget>><<if $pe eq 0>>
<<ArrogantYoungMaster>>
As you step closer to the disturbance, the young master stops mid-insult. He leaves the trembling server and turns his full, predatory attention toward you.
Up close, he is a youth no older than twenty, hair pinned with golden clasps, his silk robes shimmering with a faint spiritual glow that marks him as a pampered disciple. He scans you from head to toe, a sharp smirk spreading across his face.
<span class="male">“So,”</span> he says, voice dripping with unearned superiority. <span class="male">“A wandering insect thinks she can intervene? This tavern is full of rats, but you... you have a certain flavor.”</span>
He steps into your personal space, his entourage fanning out behind him with smug, expectant grins.
<span class="male">“Crawl to me on all fours, and I may forgive you for breathing my air.”</span>
The tavern goes deathly silent. He leans in closer, his eyes dark. <span class="male">“Or don’t. I’ll enjoy breaking your legs and watching you squirm in the dirt anyway.”</span>
<hr>
<div id="choice">\
<<link "Obey him. Crawl.">><<set $backgroundClass to "tavern">>
<<replace "#choice">>
The words hang in the air like poison.
<span class="male">“Crawl to me on all fours.”</span>
Laughter bubbles from his entourage, cruel and excited. The tavern watches in uncomfortable silence — but no one stops you as you slowly, deliberately, drop to your knees.
<<set _random0 = random(0,2)>>
You place your palms to the dusty wooden floor and begin to crawl toward him.
<<if _random0 eq 0>>
<img src="images/Sex/crawl.webp" class="nsfw-glow"><<elseif _random0 eq 1>>
<img src="images/Sex/crawl1.webp" class="nsfw-glow"><<elseif _random0 eq 2>>
<img src="images/Sex/crawl3.webp" class="nsfw-glow"><</if>>
<span class="male">“Good,”</span>he purrs, voice silk-wrapped steel. <span class="male">“See? Even lowly insects can learn obedience.”</span>
When you reach him, he lifts one foot and presses the sole of his ornate boot against your shoulder — not hard enough to hurt, but enough to assert dominance.
<span class="male">“Now beg me to let you serve me in private.”</span>
<<linkappend "You’re taken to a private backroom. The guards remain outside.">>
<<set $backgroundClass to "tavernRoom">>
Inside, the arrogant young master watches you with idle amusement as he reclines on a padded seat. He undoes the sash of his inner robe, letting it slide open just enough to reveal his bare chest… and the growing bulge beneath silk pants.
<span class="male">“Strip, then crawl here and use your mouth. You’ll start there, and if I’m pleased, I’ll use the rest of you.”</span>
On your knees before him, you free his cock — thick, flushed, already hard with anticipation. He’s arrogant about it too, holding your chin and tapping the tip against your lips before letting you take him into your mouth.
<span class="male">“Not bad… for a nobody.”</span>
<div style="position: relative; width: 70%; height: auto;">
<<BackgroundHandler>>
<img src="images/Sex/sideBlowjob.webp" style="width: 100%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">
</div>
He moans as you work your lips along his shaft, guiding your rhythm with one hand tangled in your hair. The position is degrading, and that’s exactly how he wants it.
After he’s had enough, he pulls back and stands.
<<Penetration_roll>>
<<if _penetration eq "vaginal">>
<<set _position to ["doggy","cowgirl"].random()>>
<<if _position eq "doggy">>
<<AymTavernImg>>
<<if $virginity eq 1>><<set $virginity = 0>><<set $virginityLost = _npc.fullname>><<set $humanSexCount += 1>>
<span class="red">You lost your virginity to _npc.fullname!</span>
<</if>>
<span class="male">“Turn around. On all fours — like the dog you are.”</span>
You obey, pressing your chest to the cushions as he mounts you from behind.
<<set_aym_doggy_desc>>
_random_desc_1
<<set_aym_doggy_talk>>
<span class="male">"_random_talk_1"</span>
_random_desc_2
<span class="male">"_random_talk_2"</span>
_random_desc_3
<span class="male">"_random_talk_3"</span>
<<linkappend "It wasnt really long before you heard a grunts of incoming orgasm from the guy.">>
<<AymFinisher>>
<span class="male"> "_finisher_talk_1" </span>
_finisher_desc_1
<<link "Gather your things and leave in shame" $passage>><<set $sexFame += random(4,7)>><<set $pe to 0>><<if $corruption lt 50>><<set $corruption +=2>><</if>><</link>>
<</linkappend>>
\
<<elseif _position eq "cowgirl">>
<<AymTavernImg>>
<<if $virginity eq 1>>
<<set $virginity = 0>>
<<set $virginityLost = _npc.fullname>><<set $humanSexCount += 1>>
<span class="red">You lost your virginity to _npc.fullname!</span>
<</if>>
<<set_aym_cowgirl_desc>>
_random_desc_1
<<set_aym_cowgirl_talk>>
<span class="male">"_random_talk_1"</span>
_random_desc_2
<span class="male">"_random_talk_2"</span>
_random_desc_3
<span class="male">"_random_talk_3"</span>
<<linkappend "It wasn't really long before you heard a grunts of incoming orgasm from the guy.">>
<<AymFinisher>>
\
<span class="male"> "_finisher_talk_1" </span>
_finisher_desc_1
\
<<link "Gather your things and leave in shame" $passage>><<set $sexFame += random(4,7)>><<set $pe to 0>><<if $corruption lt 50>><<set $corruption +=2>><</if>><</link>>
<</linkappend>>
<</if>>
\
<<elseif _penetration eq "anal">>
\
<<if $analVirginity eq 1>><<set $humanSexCount += 1>>
<<set $analVirginity = 0>>
<<set $analVirginityLost = _npc.fullname>>
<span class="red">You lost your anal virginity to _npc.fullname!</span>
<</if>>
\
<<AymTavernImg>>
<<set_aym_proneboneANAL_desc>>
_random_desc_1
<<set_aym_proneboneANAL_talk>>
<span class="male">"_random_talk_1"</span>
_random_desc_2
<span class="male">"_random_talk_2"</span>
_random_desc_3
<span class="male">"_random_talk_3"</span>
<<linkappend "It wasnt really long before you heard a grunts of incoming orgasm from the guy.">>
<<AymFinisher>>
<span class="male"> "_finisher_talk_1" </span>
_finisher_desc_1
<<link "Gather your things and leave in shame" $passage>><<set $sexFame += random(4,7)>><<set $pe to 0>><<if $corruption lt 50>><<set $corruption +=2>><</if>><</link>>
<</linkappend>>
<</if>>
<</linkappend>>
<</replace>>
<</link>>
<<link "Refuse with pride.">>
<<replace "#choice">>
You cross your arms and stare him down, utterly unmoved.
<span class="player">"I don't bow to worms dressed in silk."</span>
The room goes still.
The young master’s eyes flash with fury. <span class="male">“Break her knees.”</span>
<<if $totalFame gt 500>>
<<set _roll to random(0,100)>>
<<if _roll lt 50>>
<span class="male1">"Wait… that’s $playername $playersurname. The one who crippled a Core disciple with a single palm at the trial grounds.”</span>
_npc.fullname blinks. His hand freezes mid-gesture.
One of the guards leans in and whispers something urgently in his ear.
The young master’s face turns pale. He swallows.
<span class="male">“Tch. This place isn't worth dirtying my hands.”</span>
He spins on his heel, robes whipping the air. <span class="male">“Come, we’re leaving.”</span>
<<else>>
<span class="male1"> “Wait!”</span>One of his guards steps in front of him, looking visibly uneasy. <span class="male1"> “That’s the $playername $playersurname ”</span>The young master freezes. His lips press into a thin line.
Around the room, people are whispering your name. Several onlookers shift in their seats—one even lifts their cup in a silent toast.
<span class="male">“Tch… Don’t think your fame makes you untouchable forever.”</span> But the words are hollow. He turns and storms out, his entourage following, visibly shaken.
<</if>>\
<i>Try to stop him?</i>
<<link "Stop him!" "Arrogant Young Master Tavern">><<set $pe to 10>><</link>>
<<else>>
The room goes quiet. His smirk fades.
<span class="male">"Worm?"</span>His voice rises slightly. <span class="male">“Who the fuck do you think you are?”</span>
You sense it—the shift. There's no recognition in the room. No fear in the guards’ eyes. The patrons look away, uninterested. No one whispers your name.
You’re no one. Not yet.
The room goes quiet. His smirk fades.
<span class="male">"Worm?"</span>His voice rises slightly. <span class="male">“Who the fuck do you think you are?”</span>
You sense it—the shift. There's no recognition in the room. No fear in the guards’ eyes. The patrons look away, uninterested. No one whispers your name.
You’re no one. Not yet.
The young master’s face twists with fury.
<span class="male">“Then I’ll beat the dignity into you. I’ll break your legs and feed your spiritual root to dogs.”</span>
<<BeforeBattle>>
<<link "To battle!" "TavernBattle">><<set $pe to 0>><<set $nextPe to 1>><<set $passage to "TavernBattle">><</link>>
<</if>>
<</replace>>
<</link>>
<<link "Mock him back.">>
<<replace "#choice">>
The arrogant young master’s lip curls in contempt as he stands before you, his hand lazily gesturing to the floor.
<span class="male"> “Crawl to me, and I may spare you from becoming a cripple tonight.”</span>You lean back in your chair, smile slow and mocking.
<span class="player"> “You want me on all fours? Buy me dinner first, young master.”</span>
The moment hangs in the air like drawn steel. A few chuckles ripple through the tavern—but they die quickly. No one shouts your name. No gasps of recognition. You’re just… some nobody with a sharp tongue.
The young master’s smile fades.
<span class="male">“What did you just say?”</span>. His voice trembles—not from fear, but from barely suppressed rage. He turns slowly toward his guards.
<span class="male">Break their jaw. Then break their hands. Let’s see how funny they are with no tongue or fingers.”</span>
His guards start moving—this time with no hesitation.
<<BeforeBattle>>
<<link "To battle!" "TavernBattle">><<set $pe to 0>><<set $nextPe to 1>><<set $passage to "TavernBattle">><</link>>
<</replace>>
<</link>>
<<elseif $pe eq 1>>
<<nobr>>
<br>You catch the next guard’s wrist mid-swing.
<br>CRACK. His bone breaks in your grip. Another guard draws a sword—you flick two fingers, and his blade shatters.
<br>The young master stumbles back, wide-eyed. He stammers.
<br><span class="male">“Y-You dare hit me?! My father is the Sect Lord of—”</span>
<div id="choice">
<br><<link "Slap him across the face">>
<br><<replace "#choice">>
<br>You casually raise your hand—and deliver a thunderous slap.
<br><div style="position: relative; width: 70%; height: auto;"><<BackgroundHandler>><img src="images/Story/bitchslap.webp" style="width: 100%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);"></div>
<br>A shockwave ripples out. The young master spins mid-air before crashing into the bamboo thicket.
<br><span class="male">"Y-you—!"</span> He spits blood and teeth.
<br>The guards glance at each other—then drop their weapons and flee.
<br><span class="player">“Tell your father: the world doesn't bend for spoiled children.”</span>
<br><<link "Go back" $city>> <<set $PCrighteousreputation += 1>><<set $fame += random(3,6)>> <</link>>
<</replace>>
<</link>>
<br><<link "Step forward and crush his pride">>
<br><<replace "#choice">>
<br>You step closer, gaze like a blade.
<br><span class="player">"Your father's title means nothing here."</span>
<br>Your aura flares—dense, suffocating. He drops to his knees before he even realizes.
<br>He can't meet your eyes.
<br>The remaining guards scatter without a word.
<br>You turn away, leaving them behind like dust in the wind.
<br><<link "Go back" $city>> <<set $PCdemonicreputation += 1>> <<set $fame += random(3,6)>><</link>>
<</replace>>
<</link>>
<br><<link "Let him run—like the coward he is">>
<br><<replace "#choice">>
<br>You say nothing. Just look at him.
<br>The pressure in the air thickens. He trembles, then bolts into the forest, stumbling over his own ego.
<br>The remaining guards scatter like leaves.
<br><<link "Go back" $city>> <<set $fame += random(3,6)>> <</link>>
<</replace>>
<</link>>
</div>
<</nobr>>
<<elseif $pe eq 2>>
The arrogant young master towers above you as you sprawl on the tavern’s wooden floor, breath ragged from the blows his guards landed. The world smells of spilled wine and smoke, and every gaze in the room is fixed on you—waiting, whispering.
<span class="male">“Still defiant?” </span>
His voice drips with mockery. He presses the heel of his embroidered boot harder into your belly.
<span class="male">“Let’s see how long that dignity lasts, insect.”</span>
The pressure is unbearable. Your body spasms, bladder straining. You claw at the floorboards, cheeks flushing with humiliation. A choked sound escapes your throat as your muscles finally betray you.
A dark warmth spreads beneath you, soaking through the silk of your dress. The humiliating hiss of liquid is unmistakable as your thighs grow wet. You’re pissing yourself—helpless, humiliated, right there on the tavern floor.
Laughter ripples through the air. The young master leans closer, his hand sliding up your leg possessively, fingers pressing into your trembling thigh. His smirk is wide, cruel, triumphant.
<img src="images/Sex/piss.webp" style="width: 70%; display: block; margin: 10px auto;">
<span class="male">“There. Look at you now. A proud cultivator… reduced to a piss-soaked dog. Remember this the next time you dare raise your voice to me.”</span>
The puddle spreads, steam rising faintly in the heat of the tavern. Your blue eyes meet his for a fleeting moment—shame burning so hot it almost eclipses your fear. Almost.
<<link "Gather your things and leave in shame" $city>><<set $sexFame += random(2,5)>><<set $pe to 0>><<if $corruption lt 50>><<set $corruption +=2>><</if>><<set $combatFame -= 1>><<set $fame -= 2>><</link>>
<</if>><<set _npc to $currentEncounterNPC>>
<<if _npc is undefined>>
<p>Encounter data is missing.</p>
<<if $encounterOriginPassage>>
<<link "Back" $encounterOriginPassage>><</link>>
<</if>>
<<else>>
<<set _isMet to !!_npc.isMet>>
<<set _wasUnknown to !!_npc.isUnknown>>
<<set _sexualAdvanceFlag to false>>
<<set _playerHarassedFlag to false>>
<<set _playerForcedFlag to false>>
<div class="encounter-interaction">
<h3>
<<if !_isMet>>
Approaching a stranger...
<<elseif _npc.isRelative>>
Approaching <<print _npc.fullname>> — a familiar face...
<<else>>
Approaching <<print _npc.fullname>>...
<</if>>
</h3>
<div class="encounter-portrait-large">
<<if _npc.enemyimage and _npc.enemyregion>>
<img @src="'images/NPC/' + _npc.gender + '/' + _npc.npcPortrait + '.webp'" width="80%" class="location-bg">
<<else>>
<div class="portrait-placeholder">❓</div>
<</if>>
</div>
<div id="interaction-result"></div>
<div id="choice-container">
<<if !_isMet>>
<<link "Introduce yourself">>
<<set _npc.isMet to true>>
<<set _npc.isUnknown to false>>
<<set _npc.NPClocation to $PlayerLocation>>
<<if !$known_npc_list.some(n => n.id === _npc.id)>>
<<AddNPCWithFamily _npc>>
<<else>>
<<set _idx to $known_npc_list.findIndex(n => n.id === _npc.id)>>
<<set $known_npc_list[_idx].isMet to true>>
<<set $known_npc_list[_idx].isUnknown to false>>
<<run Object.assign($known_npc_list[_idx], _npc)>>
<</if>>
/* Refresh the page to show the new interaction menu */
<<run Engine.play(passage())>>
<</link>>
<<else>>
<!-- ========== NPC-INITIATED HARASSMENT (can escalate to forced sex) ========== -->
<<set _randomchance to random(1,100)>>
<<if _randomchance lt 20>>
<<set _npcWantsHarass to (
(_npc.depravity > 60) or
(["Wicked","Evil","Selfish"].includes(_npc.internalTrait)) or
(["Power-hungry","Self centered"].includes(_npc.externalTrait)) or
($corruption > 20 and _npc.depravity > 40)
)>>
<<if not _playerHarassedFlag and _npcWantsHarass>>
<<link "??? (something feels off)">>
<<set _playerHarassedFlag = true>>
<<set _roll to random(1,100)>>
<<set _baseChance to 40 + (_npc.depravity / 2) - ($corruption / 2) - ($charisma / 2)>>
<<set _chance to Math.max(10, Math.min(90, _baseChance))>>
<<set _text = "">>
<<set _friendshipChange = 0>>
<<set _corruptionChange = 0>>
<<set _npcDepravityChange = 0>>
<<set _forcedSex = false>>
<<if _roll lt _chance>>
<<set _harassType to random(1,6)>> <!-- 6 variants now -->
<<if _harassType eq 1>>
<img src="images/Sex/waistgrab.webp" class="nsfw-glow">
<<set _text = `${_npc.fullname} steps close, grabbing your waist with both hands. <span class="${_npc.gender}">"So tempting,"</span> they whisper, squeezing your ${_npc.gender eq "male" ? "hips" : "rear"} roughly.`>>
<<elseif _harassType eq 2>>
<img src="images/Sex/kissing.webp" class="nsfw-glow">
<<set _text = `${_npc.fullname} presses you against the wall, their lips crushing yours in a forceful kiss. Their tongue invades your mouth without consent.`>>
<<elseif _harassType eq 3>>
<img src="images/Sex/titgrab.webp" class="nsfw-glow">
<<set _text = `${_npc.fullname} pulls at your robes, exposing your shoulder. <span class="${_npc.gender}">"I've been wanting this for a while,"</span> they growl, groping your chest.`>>
<<elseif _harassType eq 4>>
<img src="images/Sex/thighgrab.webp" class="nsfw-glow">
<<set _text = `${_npc.fullname} slides a hand under your robes, fingers brushing against your inner thigh. <span class="${_npc.gender}">"Don't make a sound,"</span> they murmur.`>>
<<elseif _harassType eq 5>>
<img src="images/Sex/grinding.webp" class="nsfw-glow">
<<set _text = `${_npc.fullname} turns you around, pressing their body against yours, grinding their ${_npc.gender eq "male" ? "hardness" : "hips"} against you. <span class="${_npc.gender}">"You'll learn to enjoy this."</span>`>>
<<else>>
<img src="images/Sex/waistgrab1.webp" class="nsfw-glow">
<<set _text = `${_npc.fullname} grabs your wrist and pulls you close, their other hand groping your backside. <span class="${_npc.gender}">"What a delicious little cultivator."</span>`>>
<</if>>
<<set _friendshipChange = -15>>
<<set _npcDepravityChange = 5>>
<<set _corruptionChange = 3>>
<!-- Chance to escalate to forced sex if NPC is very depraved and not much weaker -->
<<if _npc.depravity > 51 and _npc.power >= $playerPower - 1>>
<<set _forceRoll = random(1,100)>>
<<if _forceRoll lt 30>>
<<set _forcedSex = true>>
<<set _text += ` Before you can react, they overpower you, dragging you into the shadows. <span class="${_npc.gender}">"I'll take what I want,"</span> they snarl.`>>
<<set _friendshipChange = -30>>
<<set _corruptionChange = 10>>
<<set _npcDepravityChange = 8>>
<</if>>
<</if>>
<<if $corruption > 60>>
<<set _text += ` Your body betrays you with a shiver of pleasure. They notice and smirk.`>>
<<set _friendshipChange = 0>>
<<set _corruptionChange = 8>>
<<elseif $corruption > 30>>
<<set _text += ` You manage to push them away, but your pulse races.`>>
<<else>>
<<set _text += ` You shove them back, face red with anger. <span class="player">"Get away!"</span>`>>
<</if>>
<<else>>
<<set _text = `${_npc.fullname} looks at you hungrily, but seems to reconsider. They step back, muttering <span class="${_npc.gender}">"Not now..."</span>`>>
<<set _friendshipChange = -5>>
<</if>>
<<for _i = 0; _i lt $known_npc_list.length; _i++>>
<<if $known_npc_list[_i].id eq _npc.id>>
<<set $known_npc_list[_i].friendship += _friendshipChange>>
<<set $known_npc_list[_i].depravity += _npcDepravityChange>>
<<break>>
<</if>>
<</for>>
<<set $corruption += _corruptionChange>>
<<if _forcedSex>>
<<set $sexPartner = _npc>>
<<set $sexType = "forced_npc">>
<<goto "EncounterInteractionSex">>
<<else>>
<<replace "#interaction-result">>
<div class="result animate-fade-in">
<p><<print _text>></p>
<p class="cyan-text">✦ Friendship: <<if _friendshipChange gt 0>>+<</if>><<print _friendshipChange>> | Corruption: +<<print _corruptionChange>> | NPC depravity: +<<print _npcDepravityChange>> ✦</p>
<<link "Continue" $encounterOriginPassage>><</link>>
</div>
<</replace>>
<<replace "#choice-container">><</replace>>
<</if>>
<</link>>
<</if>>
<</if>>
<!-- ========== PLAYER AGGRESSIVE OPTIONS (unchanged except using power) ========== -->
<<if $corruption gt 30 and $playerPower gt _npc.power>>
<<link "Intimidate">>
<<set _roll to random(1,100)>>
<<set _chance to 40 + ($corruption / 2) + ($charisma / 2) - (_npc.depravity / 2)>>
<<set _friendshipChange = 0>>
<<replace "#interaction-result">>
<div class="result animate-fade-in">
<<if _roll lt _chance>>
<<set _friendshipChange = -10>>
<<set $corruption += 2>>
<p>You flare your aura, letting your cultivation pressure bear down on <<print _npc.name>>. They pale, stammering apologies, hands trembling.</p>
<p class="warning-text">✦ Friendship decreased, corruption increased. ✦</p>
<<else>>
<<set _friendshipChange = 5>>
<p>You try to pressure them, but they refuse to yield, meeting your eyes with defiance.</p>
<p class="cyan-text">✦ They are not impressed. ✦</p>
<</if>>
<<for _i = 0; _i lt $known_npc_list.length; _i++>>
<<if $known_npc_list[_i].id eq _npc.id>>
<<set $known_npc_list[_i].friendship += _friendshipChange>>
<<break>>
<</if>>
<</for>>
<<link "Continue" $encounterOriginPassage>><</link>>
</div>
<</replace>>
<<replace "#choice-container">><</replace>>
<</link>>
<</if>>
<<if $corruption gt 40>>
<<link "Grope">>
<<set _roll to random(1,100)>>
<<set _chance to 40 + ($corruption / 2) + (($playerPower - _npc.power) * 10)>>
<<set _text = "">>
<<set _friendshipChange = 0>>
<<set _corruptionChange = 0>>
<<set _npcDepravityChange = 0>>
<<if _roll lt _chance>>
<<if _npc.gender eq "male">>
<<set _text = `You boldly run your hand down ${_npc.fullname}'s chest, fingers brushing over their hardening nipples. They gasp but don't pull away.`>>
<<else>>
<<set _text = `You reach around and cup ${_npc.fullname}'s ass, squeezing firmly. They inhale sharply but lean into your touch.`>>
<</if>>
<<set _friendshipChange = -5>>
<<set _corruptionChange = 4>>
<<set _npcDepravityChange = 3>>
<<if random(1,100) < _npc.depravity>>
<<set _text += ` Instead of resisting, they press against you, a hungry moan escaping their lips.`>>
<<set _friendshipChange = 2>>
<</if>>
<<else>>
<<set _text = `Your hand is slapped away. ${_npc.fullname}'s face twists in disgust. <span class="${_npc.gender}">"How dare you!"</span>`>>
<<set _friendshipChange = -15>>
<</if>>
<<for _i = 0; _i lt $known_npc_list.length; _i++>>
<<if $known_npc_list[_i].id eq _npc.id>>
<<set $known_npc_list[_i].friendship += _friendshipChange>>
<<set $known_npc_list[_i].depravity += _npcDepravityChange>>
<<break>>
<</if>>
<</for>>
<<set $corruption += _corruptionChange>>
<<replace "#interaction-result">>
<div class="result animate-fade-in">
<p><<print _text>></p>
<p class="cyan-text">✦ Friendship: <<if _friendshipChange gt 0>>+<</if>><<print _friendshipChange>> | Corruption: +<<print _corruptionChange>> | NPC depravity: +<<print _npcDepravityChange>> ✦</p>
<<link "Continue" $encounterOriginPassage>><</link>>
</div>
<</replace>>
<<replace "#choice-container">><</replace>>
<</link>>
<</if>>
<<if $corruption gt 50>>
<<link "Make a bold move">>
<<set _roll to random(1,100)>>
<<set _chance to 30 + ($corruption / 2) + (($playerPower - _npc.power) * 10)>>
<<set _text = "">>
<<set _friendshipChange = 0>>
<<set _corruptionChange = 0>>
<<set _npcDepravityChange = 0>>
<<if _roll lt _chance>>
<<set _text = `You grab ${_npc.fullname} by the waist, pulling them close. Your lips brush their neck, teeth grazing skin. <span class="player">"Don't resist,"</span> you murmur. They shiver, yielding to you.`>>
<<set _friendshipChange = -5>>
<<set _corruptionChange = 6>>
<<set _npcDepravityChange = 4>>
<<set $sexPartner = _npc>>
<<set $sexType = "aggressive_player">>
<<goto "EncounterInteractionSex">>
<<else>>
<<set _text = `${_npc.fullname} pushes you away firmly. <span class="${_npc.gender}">"Enough! I'll not be toyed with."</span>`>>
<<set _friendshipChange = -15>>
<</if>>
<<for _i = 0; _i lt $known_npc_list.length; _i++>>
<<if $known_npc_list[_i].id eq _npc.id>>
<<set $known_npc_list[_i].friendship += _friendshipChange>>
<<set $known_npc_list[_i].depravity += _npcDepravityChange>>
<<break>>
<</if>>
<</for>>
<<set $corruption += _corruptionChange>>
<<if not (_roll lt _chance)>>
<<replace "#interaction-result">>
<div class="result animate-fade-in">
<p><<print _text>></p>
<p class="cyan-text">✦ Friendship: <<if _friendshipChange gt 0>>+<</if>><<print _friendshipChange>> | Corruption: +<<print _corruptionChange>> | NPC depravity: +<<print _npcDepravityChange>> ✦</p>
<<link "Continue" $encounterOriginPassage>><</link>>
</div>
<</replace>>
<<replace "#choice-container">><</replace>>
<</if>>
<</link>>
<</if>>
<<if $corruption gt 70 and $playerPower gt (_npc.power + 1)>>
<<link "Overwhelm">>
<<set $maxArousal to 100>>
<<set _roll to random(1,100)>>
<<set _chance to 20 + ($corruption / 2) + ($charisma / 2) - (_npc.depravity / 2)>>
<<set _friendshipChange = 0>>
<<if _roll lt _chance>>
<<set $corruption += 12>>
<<set _friendshipChange = -40>>
<<set $sexPartner = _npc>>
<<set $sexType = "rape_player">>
<<GenerateGrudge _npc "rape">>
<<goto "EncounterInteractionSex">>
<<else>>
<<set _friendshipChange = -25>>
<<replace "#interaction-result">>
<div class="result animate-fade-in">
<p>Your attempt to force them fails when they scream for help. You flee before guards arrive, but your reputation suffers.</p>
<p class="red-text">✦ The encounter ends badly. ✦</p>
<<link "Continue" $encounterOriginPassage>><</link>>
</div>
<</replace>>
<<replace "#choice-container">><</replace>>
<</if>>
<<for _i = 0; _i lt $known_npc_list.length; _i++>>
<<if $known_npc_list[_i].id eq _npc.id>>
<<set $known_npc_list[_i].friendship += _friendshipChange>>
<<set $known_npc_list[_i].depravity += 5>>
<<break>>
<</if>>
<</for>>
<</link>>
<</if>>
<!-- ========== CONSENSUAL SCENES ========== -->
<<link "Flirt">>
<<set _roll to random(1,100)>>
<<set _chance = 40 + ($charisma / 2) + ($corruption / 10) - (_npc.depravity / 5)>>
<<replace "#interaction-result">>
<div class="result animate-fade-in">
<<if _roll lte _chance>>
<<set _gain to random(5,15)>>
<<set _npc.friendship += _gain>>
<<set $corruption += 1>>
<p>You exchange a few charged words. The mood shifts in your favor.</p>
<<if _npc.depravity > 50>>
<p><span class="${_npc.gender}">${_npc.fullname}</span> gives you a knowing smile. <span class="${_npc.gender}">"Perhaps we could find someplace quieter..."</span></p>
<<link "Accept the invitation">>
<<set $sexPartner = _npc>>
<<set $sexType = "consensual_flirt">>
<<goto "EncounterInteractionSex">>
<</link>>
<<else>>
<p class="gold-text">✦ Success! Friendship increased. ✦</p>
<<link "Continue" $encounterOriginPassage>><</link>>
<</if>>
<<else>>
<<set _npc.friendship -= random(2,5)>>
<p>Your advance is politely rejected.</p>
<<link "Continue" $encounterOriginPassage>><</link>>
<</if>>
<<for _i = 0; _i lt $known_npc_list.length; _i++>>
<<if $known_npc_list[_i].id eq _npc.id>>
<<set $known_npc_list[_i].friendship = _npc.friendship>>
<<set $known_npc_list[_i].depravity = _npc.depravity>>
<<break>>
<</if>>
<</for>>
</div>
<</replace>>
<<replace "#choice-container">><</replace>>
<</link>>
<<if $corruption gt 50 and _npc.depravity gt 40>>
<<link "Seduce">>
<<set _roll to random(1,100)>>
<<set _chance = 30 + ($charisma / 2) + ($corruption / 2)>>
<<replace "#interaction-result">>
<div class="result animate-fade-in">
<<if _roll lte _chance>>
<<set _npc.friendship += 25>>
<<set _npc.depravity += 10>>
<<set $corruption += 5>>
<p>You whisper promises in their ear, your hand slipping beneath their robes. They follow you eagerly to a private spot.</p>
<<link "Seize the moment">>
<<set $sexPartner = _npc>>
<<set $sexType = "consensual_seduce">>
<<goto "EncounterInteractionSex">>
<</link>>
<<else>>
<<set _npc.friendship -= 15>>
<p>They recoil in horror. <span class="${_npc.gender}">"Get away from me!"</span></p>
<p class="red-text">✦ Failure. ✦</p>
<<link "Continue" $encounterOriginPassage>><</link>>
<</if>>
<<for _i = 0; _i lt $known_npc_list.length; _i++>>
<<if $known_npc_list[_i].id eq _npc.id>>
<<set $known_npc_list[_i].friendship = _npc.friendship>>
<<set $known_npc_list[_i].depravity = _npc.depravity>>
<<break>>
<</if>>
<</for>>
</div>
<</replace>>
<<replace "#choice-container">><</replace>>
<</link>>
<</if>>
<<link "Observe from afar">>
<<set $insight += 1>>
<<set _npc.friendship += 2>>
<<for _i = 0; _i lt $known_npc_list.length; _i++>>
<<if $known_npc_list[_i].id eq _npc.id>>
<<set $known_npc_list[_i].friendship += 2>>
<<break>>
<</if>>
<</for>>
<<replace "#interaction-result">>
<div class="result animate-fade-in">
<p>You watch <<print _npc.fullname>> from a distance and learn a little more about them.</p>
<p class="cyan-text">✦ Insight +1 | Friendship +2 ✦</p>
<<link "Continue" $encounterOriginPassage>><</link>>
</div>
<</replace>>
<<replace "#choice-container">><</replace>>
<</link>>
<<link "Back" $encounterOriginPassage>><</link>>
<</if>>
</div>
</div>
<</if>><<set _partner to $sexPartner>>
<<set _type to $sexType>>
<<set _dominance to $dominance>>
<<set _returnPassage to $sexReturnPassage ?? $encounterOriginPassage>>
<<if not $maxArousal>>
<<set $maxArousal = 100>>
<</if>>
<div id="casualSexContainer">
<<if _type eq "forced_npc">>
<<CasualSex _partner "vengeance" "sub" "full" _returnPassage null _type>>
<<elseif _type eq "aggressive_player">>
<<CasualSex _partner "dominance" "dom" "full" _returnPassage null _type>>
<<elseif _type eq "rape_player">>
<<CasualSex _partner "cruelty" "dom" "full" _returnPassage null _type>>
<<elseif _type eq "consensual_flirt">>
<<CasualSex _partner "affection" "neutral" "full" _returnPassage null _type>>
<<elseif _type eq "consensual_seduce">>
<<CasualSex _partner "seduction" "neutral" "full" _returnPassage null _type>>
<<elseif _type eq "revenge_victory">>
<<CasualSex _partner "triumph" "dom" "full" _returnPassage null _type>>
<<elseif _type eq "revenge_loss">>
<<CasualSex _partner "humiliation" "sub" "full" _returnPassage null _type>>
<<elseif _type eq "brothel_hire">>
<<CasualSex _partner "pleasure" "neutral" "full" _returnPassage null _type>>
<<elseif _type eq "brothel_work">>
<<CasualSex _partner "service" "sub" "full" _returnPassage null _type>>
<<elseif _type eq "mission_sex">>
<<CasualSex _partner "duty" $missionDominance "full" _returnPassage null _type>>
<<elseif _type eq "merchant">>
<<CasualSex _partner _reason _dominance "full" _returnPassage null _type>>
<<else>>
<<CasualSex _partner "intimacy" "neutral" "full" _returnPassage null "casual">>
<</if>>
</div><<link "go back" "Map|Region1">><</link>>
<<if $pe eq 0>>
\<<CreateNPC_Region1>>\
You've met _fullname
<<set _currenthealthNPC to _maxhealthNPC>>
<<set _currentenergyNPC to _maxenergyNPC>>
_intTrait
_extTrait
_cultivation
_currenthealthNPC / _maxhealthNPC
_currentenergyNPC / _maxenergyNPC
<<BeforeBattle>>
<<link "Battle1" "Battle1">><<set $passage to "Battle1">><<set $pe=0>><</link>>
[[x->HpLowEncounter][$pe=1]]
<<elseif $pe eq 1>>
You are fighting <<print $currentEnemy.fullname>>
Cultivation: <<print $currentEnemy.realm>>
HP: <<print $currentEnemy.NPCcurrenthealth>> / <<print $currentEnemy.NPCmaxhealth>>
Energy: <<print $currentEnemy.NPCcurrentenergy>> / <<print $currentEnemy.NPCmaxenergy>>
[[x2->HpLowEncounter][$pe=2]]
<<elseif $pe eq 2>>
<<if $health lte 0>>
You've lost!
<<elseif $currentEnemy.NPCcurrenthealth lte 0>>
You've won!
Do you want to
<<link "Kill enemy" "HpLowEncounter">> <<set $pe to 3>><</link>>
<<link "Humiliate enemy" "HpLowEncounter">> <<set $pe to 4>><</link>>
<<link "Spare him" "HpLowEncounter">><<set $pe to 5>><</link>>
<<else>>
<<PlayerTurn>>
<<EnemyTurn>>
<</if>>
[[contine->HpLowEncounter][$pe=1]]
<<elseif $pe eq 3>>
You've killed $currentEnemy.fullname
You gained some of his items!
<<link "Continue" "Map|Region1">>
<<set $pe to 0>><</link>>
<<elseif $pe eq 4>>
$currentEnemy.fullname won't forget this humiliation! He may seek revenge later!
<<set $currentEnemy.friendship to -5>>
<<set $currentEnemy.relationshipType to "rival">>
<<link "Continue" "Map|Region1">> <<BattleAddNPC>> <<set $pe to 0>><</link>>
<<elseif $pe eq 5>>
$currentEnemy.fullname is gratefull for your action! He will remember this!
<<set $currentEnemy.friendship to 1>>
<<set $currentEnemy.relationshipType to "friend">>
<<link "Continue" "Map|Region1">> <<set $pe to 0>><<BattleAddNPC>> <</link>>
<</if>><<if $pe eq 0>>
<<set _grudge to $currentRevengeGrudge>>
<<set _avenger to $known_npc_list.find(function(n) { return n.id === _grudge.avengerId; })>>
/* Failsafe origin passage */
<<set $encounterOriginPassage to $encounterOriginPassage || "Map|Region1">>
<div class="encounter-interaction">
<h3>✦ A Shadow from the Past ✦</h3>
<div class="encounter-portrait-large">
<<if _avenger.enemyimage and _avenger.enemyregion>>
<img @src="'images/' + _avenger.enemyregion + '/' + _avenger.enemyimage + '.jpg'" width="80%">
<<else>>
<div class="portrait-placeholder">⚔️</div>
<</if>>
</div>
<div id="revenge-result" class="result">
<<if _grudge.type eq "rape">>
<p><span @class="_avenger.gender"><<print _avenger.fullname>></span> blocks your path, eyes burning with fury.</p>
<p><span @class="_avenger.gender">"You defiled <<print _grudge.victimName>>! The heavens may forgive, but I will not!"</span></p>
<<elseif _grudge.type eq "murder">>
<p><span @class="_avenger.gender"><<print _avenger.fullname>></span> steps forward, grief and rage twisting their features.</p>
<p><span @class="_avenger.gender">"You took <<print _grudge.victimName>> from this world. Prepare to face justice!"</span></p>
<<elseif _grudge.type eq "seduction">>
<p><span @class="_avenger.gender"><<print _avenger.fullname>></span> confronts you, jealousy burning in their eyes.</p>
<p><span @class="_avenger.gender">"You think you can toy with <<print _grudge.victimName>>'s heart and walk free?"</span></p>
<<else>>
<p><span @class="_avenger.gender"><<print _avenger.fullname>></span> stands before you, vengeance etched into every line of their face.</p>
<p><span @class="_avenger.gender">"For what you did to <<print _grudge.victimName>>, you will pay!"</span></p>
<</if>>
<<if _avenger.power gt $playerPower>>
<p class="warning-text">Their cultivation surpasses yours. This will be a difficult battle!</p>
<<elseif _avenger.power lt $playerPower>>
<p class="cyan-text">Their cultivation is weaker. Justice may be blind, but power is not.</p>
<</if>>
</div>
<div id="revenge-choices">
<<link "Fight">>
<<set $combatOpponent to _avenger>>
<<set $combatReason to "revenge_grudge">>
<<set $nextPe to 1>>
<<BeforeBattle _avenger>>
<<goto "Battle">>
<</link>>
<<if $charisma gt 30 and $corruption lt 50>>
<<link "Attempt to talk them down">>
<<set _roll to random(1,100)>>
<<set _chance to 20 + ($charisma / 2) + ($righteousreputation / 10) - (_grudge.severity * 3)>>
<<replace "#revenge-result">>
<div class="result animate-fade-in">
<<if _roll lt _chance>>
<p>You speak of regrets, of the cruelty of fate. <span @class="_avenger.gender"><<print _avenger.fullname>></span> hesitates, their anger wavering.</p>
<p><span @class="_avenger.gender">"...Leave. Before I change my mind."</span></p>
<<set $righteousreputation += 5>>
/* Remove the grudge */
<<set $activeGrudges.deleteAt($activeGrudges.findIndex(function(g) { return g.id === _grudge.id; }))>>
<br><<link "Leave" $encounterOriginPassage>><</link>>
<<else>>
<p>Your words ring hollow. <span @class="_avenger.gender">"Lies! You will face justice!"</span></p>
<br><<link "Fight">>
<<set $combatOpponent to _avenger>>
<<set $combatReason to "revenge_grudge">>
<<set $nextPe to 1>>
<<BeforeBattle _avenger>>
<<goto "Battle">>
<</link>>
<</if>>
</div>
<</replace>>
<<replace "#revenge-choices">><</replace>>
<</link>>
<</if>>
<<if $corruption gt 60 and $playerPower gt _avenger.power>>
<<link "Crush them utterly">>
<<replace "#revenge-result">>
<div class="result animate-fade-in">
<p>You laugh, unleashing your full cultivation. <span @class="_avenger.gender"><<print _avenger.fullname>></span> is crushed beneath your might.</p>
<p class="warning-text">✦ You have proven that power is the only justice. Your demonic reputation grows. ✦</p>
<<set $demonicreputation += 20>>
<<set $hypocrisyScore += 15>>
<<set _avenger.isDead = true>>
<<set _avenger.deathCause = "revenge_killed">>
<<set _avenger.killedByPlayer = true>>
<<set _avenger.killedInRevenge = true>>
<<set _avenger.deathGrudgeType = _grudge.type>>
<<set _avenger.deathGrudgeVictim = _grudge.victimName>>
<div class="warning-text">You have slain <<print _avenger.fullname>>, who sought vengeance for <<print _grudge.victimName>>.</div>
<<set $activeGrudges.deleteAt($activeGrudges.findIndex(function(g) { return g.id === _grudge.id; }))>>
<<LogEvent "combat" "Grudge Resolved" `"You have ended the life of " + _avenger.fullname + ", who sought retribution for " + _grudge.victimName + ". Their earthly resentment is extinguished; the cycle of vengeance ends here."` 4>> <p class="cyan-text">✦ The shadow that hunted you is no more. ✦</p>
<br><<link "Continue" $encounterOriginPassage>><</link>>
</div>
<</replace>>
<<replace "#revenge-choices">><</replace>>
<</link>>
<</if>>
<<if $sectFame gt 50 and $righteousreputation gt 30>>
<<link "Invoke your reputation">>
<<replace "#revenge-result">>
<div class="result animate-fade-in">
<p>You invoke your standing in the cultivation world. <span @class="_avenger.gender"><<print _avenger.fullname>></span> hesitates, aware of the consequences.</p>
<p><span @class="_avenger.gender">"...The sects protect their own. This is not over."</span></p>
/* Delayed, but triggered set to false so it can happen again! */
<<set _grudge.timer to random(20, 60)>>
<<set _grudge.triggered to false>>
<br><<link "Leave" $encounterOriginPassage>><</link>>
</div>
<</replace>>
<<replace "#revenge-choices">><</replace>>
<</link>>
<</if>>
</div>
</div>
<<elseif $pe eq 1>>
<<set _grudge to $currentRevengeGrudge>>
<<set _avenger to $defeatedEnemy>>
<<set $encounterOriginPassage to $encounterOriginPassage || "Map|Region1">>
<div class="encounter-interaction">
<h3>✦ The Scales of Justice ✦</h3>
<div class="encounter-portrait-large">
<<if _avenger.enemyimage and _avenger.enemyregion>>
<img @src="'images/' + _avenger.enemyregion + '/' + _avenger.enemyimage + '.jpg'" width="80%">
<<else>>
<div class="portrait-placeholder">⚔️</div>
<</if>>
</div>
<div class="result">
<p>You have bested <span @class="_avenger.gender">_avenger.fullname</span> in combat. They lie at your feet, their vengeance shattered.</p>
<p>How do you resolve this?</p>
</div>
<div id="revenge-victory-choices">
<!-- Kill -->
<<link "Kill them">>
<<replace "#revenge-victory-choices">>
<div class="result">
<p>You raise your weapon and end their life. Their eyes meet yours one last time, filled with hate and despair, before the light fades.</p>
<p>As their qi scatters, you feel the weight of another death added to your conscience.</p>
<<set _avenger.isDead = true>>
<<set _avenger.deathCause = "revenge_killed">>
<<set _avenger.killedByPlayer = true>>
<<set _avenger.killedInRevenge = true>>
<<set _avenger.deathGrudgeType = _grudge.type>>
<<set _avenger.deathGrudgeVictim = _grudge.victimName>>
<<set $activeGrudges.deleteAt($activeGrudges.findIndex(function(g) { return g.id === _grudge.id; }))>>
<<set $demonicreputation += 5>>
<<set $fame += 5>>
<<set $corruption = Math.min(100, $corruption + 3)>>
<<LogEvent "combat" "Grudge Resolved" `"You have ended the life of " + _avenger.fullname + ", who sought retribution for " + _grudge.victimName + ". Their earthly resentment is extinguished; the cycle of vengeance ends here."` 4>> <p class="cyan-text">✦ The shadow that hunted you is no more. ✦</p>
<<link "Continue" $encounterOriginPassage>><</link>>
</div>
<</replace>>
<</link>>
<!-- Spare (mercy) -->
<<link "Spare their life">>
<<replace "#revenge-victory-choices">>
<div class="result">
<p>You lower your weapon. <span class="player">"Go. Your vengeance is futile."</span></p>
<p><span @class="_avenger.gender">_avenger.fullname</span> stares at you, disbelief warring with shame. They stagger to their feet.</p>
<<if _grudge.type eq "rape">>
<p><span @class="_avenger.gender">“You... you think this absolves you?”</span> they spit, but the fire in their eyes is dim.</p>
<<elseif _grudge.type eq "murder">>
<p><span @class="_avenger.gender">“Mercy? You took a life! This changes nothing!” they rasp, but they stumble away.</p>
<<else>>
<p><span @class="_avenger.gender">“This isn't over...”</span> they whisper, but their voice lacks conviction.</p>
<</if>>
<p>They retreat, humbled but not broken. The grudge may fade, or it may smoulder for years.</p>
<<set _grudge.severity = Math.max(1, _grudge.severity - 3)>>
<<set _grudge.timer = random(20, 60)>>
<<set _grudge.triggered = false>>
<<set $righteousreputation += 5>>
<<set $corruption = Math.max(0, $corruption - 2)>>
<p class="cyan-text">✦ Their grudge still simmers, but it may take a long time to reignite. ✦</p>
<<link "Continue" $encounterOriginPassage>><</link>>
</div>
<</replace>>
<</link>>
<!-- Humiliate / NSFW Spare (if avenger depraved or grudge type sexual) -->
<<if $corruption gte 60>>
<<link "Claim them as your prize" "EncounterInteractionSex">>
<<set $sexPartner = _avenger>>
<<set $sexType = "revenge_victory">>
<<set $sexReturnPassage = $encounterOriginPassage>>
<<set $activeGrudges.deleteAt($activeGrudges.findIndex(function(g) { return g.id === _grudge.id; }))>>
<<set $corruption = Math.min(100, $corruption + 8)>>
<<set $demonicreputation += 10>>
<</link>>
<</if>>
</div>
</div>
<<elseif $pe eq 2>>
<<set _grudge to $currentRevengeGrudge>>
<<set _avenger to $known_npc_list.find(function(n) { return n.id === _grudge.avengerId; })>>
<<set $encounterOriginPassage to $encounterOriginPassage || "Map|Region1">>
<<set _nsfwLoss = false>>
<div class="encounter-interaction">
<h3>✦ The Debt of Blood ✦</h3>
<div class="encounter-portrait-large">
<<if _avenger.enemyimage and _avenger.enemyregion>>
<img @src="'images/' + _avenger.enemyregion + '/' + _avenger.enemyimage + '.jpg'" width="80%">
<<else>>
<div class="portrait-placeholder">⚔️</div>
<</if>>
</div>
<div class="result">
<<if $playerLost>>
<p>You have been bested. <span class="${_avenger.gender}">${_avenger.fullname}</span> stands over you, their blade at your throat, their eyes blazing with righteous fury.</p>
/* Check for NSFW loss possibility */
<<if _avenger.depravity > 60 and ( _grudge.type eq "rape" or _grudge.type eq "seduction" )>>
<<set _nsfwLoss = true>>
<p>A dark gleam enters their eyes. <span @class="_avenger.gender">"Death would be too merciful,"</span> they murmur. <span @class="_avenger.gender">"Perhaps you need to learn what you've done... firsthand."</span></p>
<<set $sexPartner = _avenger>>
<<set $sexType = "revenge_loss">>
<<set $sexReturnPassage = $encounterOriginPassage>>
<<link "Submit">>
<<goto "EncounterInteractionSex">>
<</link>>
<<elseif _avenger.depravity > 70 or ["Wicked","Evil","Power-hungry"].includes(_avenger.internalTrait) or ["Power-hungry","Self centered"].includes(_avenger.externalTrait)>>
<<set _nsfwLoss = true>>
<p>They sheathe their weapon, a cruel smile playing on their lips. <span @class="_avenger.gender">"There are worse fates than death,"</span> they say. <span @class="_avenger.gender">"You will repay your debt... with your body."</span></p>
<<set $sexPartner = _avenger>>
<<set $sexType = "revenge_loss">>
<<set $sexReturnPassage = $encounterOriginPassage>>
<<link "Submit">>
<<goto "EncounterInteractionSex">>
<</link>>
<</if>>
<<if not _nsfwLoss>>
<<if _grudge.type eq "rape">>
<p><span @class="_avenger.gender">“Now you know how it feels to be powerless,”</span> they snarl. <span @class="_avenger.gender">“For what you did to <span class="${_avenger.gender}">${_grudge.victimName}</span>, I should end you here. But death is too kind.”</span></p>
<p>They leave you broken and humiliated, a mark of your shame forever carved into your reputation.</p>
<<set $demonicreputation += 5>>
<<set $publicReputation -= 10>>
<<set $health = Math.floor($health * 0.5)>>
<<set $corruption = Math.min(100, $corruption + 3)>>
<<LogEvent "reputation" "Public Shaming" "You were defeated by " + _avenger.fullname + ", who sought revenge for " + _grudge.victimName + ". Your reputation suffered." 3>>
<<elseif _grudge.type eq "murder">>
<p><span @class="_avenger.gender">“You took a life. Now you owe a life.”</span> The blade presses deeper, drawing blood. <span @class="_avenger.gender">“But the heavens are watching. Live with your guilt.”</span></p>
<p>They leave you bleeding, but alive – perhaps to let the weight of your crime crush you slowly.</p>
<<set $demonicreputation += 10>>
<<set $publicReputation -= 15>>
<<set $health = Math.floor($health * 0.6)>>
<<set $hypocrisyScore += 8>>
<<LogEvent "combat" "Grudge Defeat" "You were defeated by " + _avenger.fullname + ", avenging " + _grudge.victimName + ". Your shame echoes in the Jianghu." 4>>
<<else>>
<p><span @class="_avenger.gender">“This is your punishment,”</span> they say coldly. <span @class="_avenger.gender">“Let the world know what you've done. Let your shame be your cage.”</span></p>
<p>They walk away, leaving you to crawl back to the world, your pride in tatters.</p>
<<set $fame -= 5>>
<<set $publicReputation -= 5>>
<<set $health = Math.floor($health * 0.7)>>
<<LogEvent "reputation" "Defeated by Rival" "You were bested by " + _avenger.fullname + ", who sought justice for " + _grudge.victimName + "." 3>>
<</if>>
/* Grudge persists or intensifies */
<<set _grudge.severity = Math.min(10, _grudge.severity + 2)>>
<<set _grudge.timer = random(15, 45)>>
<<set _grudge.triggered = false>>
<p class="warning-text">✦ Their grudge has deepened. They will surely seek you out again. ✦</p>
<</if>>
<</if>>
<<if not _nsfwLoss>>
<<link "Return, wounded" $encounterOriginPassage>><</link>>
<</if>>
</div>
</div>
<</if>><<set $itemList to []>>
<<run Object.keys(State.variables).forEach(function(key){
let obj = State.variables[key];
if (obj && typeof obj === "object" && obj.class === "item") {
State.variables.itemList.push(obj);
}
})>>
<<set $vitalityelixirrecipe to {
"name": "Vitality Elixir",
"bloodhardeningherb": 1,
"vitalityroot": 2,
"result": {
"id": "vitalityelixir",
"name": "Vitality Elixir",
"description": "Restores vitality and inner balance.",
"effect": "restoreHealth",
"quantity": 1,
"class": "potion"
}
}>><div class="elixir-pouch-container">
<div class="inventory-header">
<h2>Your Elixir Pouch</h2>
<p>Precious pills and spiritual elixirs gathered on your path to immortality.</p>
</div>
<div id="log"></div>
<<if $playerpotioninventory.length gt 0>>
<table class="elixir-inventory-table">
<thead>
<tr>
<th style="width: 80px;"></th>
<th>Elixir</th>
<th style="width: 100px; text-align: center;">Grade</th>
<th style="width: 100px; text-align: center;">Quantity</th>
<th style="width: 120px; text-align: center;">Action</th>
</tr>
</thead>
<tbody>
<<for _potion range $playerpotioninventory>>
<<set _rarityColor to
(_potion.grade <= 1 ? "#4fc3f7" :
_potion.grade <= 3 ? "#66bb6a" :
_potion.grade <= 5 ? "#ffa726" :
"#ab47bc") >> <!-- Blue → Green → Orange → Purple -->
<tr class="elixir-row">
<td style="text-align: center;">
<div class="elixir-icon">丹</div> <!-- Replace with <img src="your-icon-url.png"> later -->
</td>
<td>
<div class="item-name" style="color: <<print _rarityColor>>;"><<print _potion.name>></div>
<<if _potion.description neq null>>
<div class="item-desc"><<print _potion.description>></div>
<</if>>
</td>
<td style="text-align: center; color: <<print _rarityColor>>; font-weight: bold;">
Grade <<print _potion.grade>>
</td>
<td style="text-align: center;">
<div class="quantity-glow"><<print _potion.quantity>></div>
</td>
<td style="text-align: center;">
<<link "Consume">>
<<set $selectedPotion to _potion>>
<<if _potion.quantity lte 0>>
<<set $playerpotioninventory.deleteAt($playerpotioninventory.indexOf(_potion))>>
<</if>>
<<replace "#use-log">>
<div class="use-log success">
<span class="glow-text">Spiritual qi surges!</span><br>
You consume the <<print _potion.name>>. A warm current flows through your meridians...
</div>
<</replace>>
<<useItem>> <!-- Apply your custom effect macro here -->
<</link>>
</td>
</tr>
<</for>>
</tbody>
</table>
<<else>>
<div class="empty-pouch">
<p>Your elixir pouch is empty.</p>
<p>Seek out rare spirit-herbs and profound catalysts to sustain your journey toward immortality.</p>
</div>
<</if>>
<div id="use-log" class="log-area"></div>
</div>
<</if>>
<</nobr>><<set $strengthboostrecipe1 to {
"name": "Strength Boost Pill (Grade 1)",
"ingredients": {
"Tempered Bone Fragment": 1,
"Blood Hardening Herb": 2
},
"result": $strengthboostpotion1
}>>
/* ═══════════════════════════════════════
STRENGTH RECIPES
merchantCost: common category, slight discount vs baseline
G1: 250 | G2: 450 | G3: 900 | G4: 2200 | G5: 4500
═══════════════════════════════════════ */
/* Grade 1 already exists: $strengthboostrecipe1 — add merchantCost manually: 250 */
<<set $strengthboostrecipe2 to {
"name": "Strength Boost Pill (Grade 2)",
"merchantCost": 450,
"ingredients": {
"Tempered Bone Fragment": 2,
"Blood Hardening Herb": 2,
"Beast Sinew Fiber": 1,
"Iron Core Husk": 1
},
"result": $strengthboostpotion2
}>>
<<set $strengthboostrecipe3 to {
"name": "Strength Boost Pill (Grade 3)",
"merchantCost": 900,
"ingredients": {
"Mountain Ox Tendon": 2,
"Ironblood Lotus Seed": 2,
"Beast Sinew Fiber": 2,
"Crimson Hide Flake": 1,
"Solar Stone Powder": 1
},
"result": $strengthboostpotion3
}>>
<<set $strengthboostrecipe4 to {
"name": "Strength Boost Pill (Grade 4)",
"merchantCost": 2200,
"ingredients": {
"Dragonbone Dust": 2,
"Titan Ape Hair": 2,
"Golden Marrow Fragment": 2,
"Vitality Root": 2,
"Thunder Lizard Hide": 1,
"Mountain Ox Tendon": 1
},
"result": $strengthboostpotion4
}>>
<<set $strengthboostrecipe5 to {
"name": "Strength Boost Pill (Grade 5)",
"merchantCost": 4500,
"ingredients": {
"Phoenix Blood Flake": 2,
"Molten Gold Dew": 1,
"Titan Ape Hair": 2,
"Dragonbone Dust": 2,
"Golden Marrow Fragment": 2,
"Heavenly Ember Flower": 2,
"Solar Stone Powder": 2
},
"result": $strengthboostpotion5
}>>
/* ═══════════════════════════════════════
AGILITY RECIPES
merchantCost: standard baseline
G1: 300 | G2: 600 | G3: 1100 | G4: 2800 | G5: 5500
═══════════════════════════════════════ */
<<set $agilityboostrecipe1 to {
"name": "Wind Step Pill (Grade 1)",
"merchantCost": 300,
"ingredients": {
"Swiftwind Feather": 2,
"Rising Mist Herb": 1
},
"result": $agilityboostpotion1
}>>
<<set $agilityboostrecipe2 to {
"name": "Wind Step Pill (Grade 2)",
"merchantCost": 600,
"ingredients": {
"Swiftwind Feather": 2,
"Shadow Step Moss": 2,
"Cloud Step Extract": 1,
"Spirit Vine Tendril": 1
},
"result": $agilityboostpotion2
}>>
<<set $agilityboostrecipe3 to {
"name": "Wind Step Pill (Grade 3)",
"merchantCost": 1100,
"ingredients": {
"Cloud Step Extract": 2,
"Shadow Step Moss": 2,
"Lightning Step Tendon": 1,
"Serpent Mark Scale": 1,
"Wind Vein Powder": 1
},
"result": $agilityboostpotion3
}>>
<<set $agilityboostrecipe4 to {
"name": "Void Stride Pill (Grade 4)",
"merchantCost": 2800,
"ingredients": {
"Lightning Step Tendon": 2,
"Void Stride Essence": 2,
"Serpent Mark Scale": 2,
"Wind Vein Powder": 2,
"Cloud Step Extract": 1,
"Voidstorm Tear": 1
},
"result": $agilityboostpotion4
}>>
<<set $agilityboostrecipe5 to {
"name": "Void Stride Pill (Grade 5)",
"merchantCost": 5500,
"ingredients": {
"Void Stride Essence": 2,
"Voidstorm Tear": 2,
"Lightning Step Tendon": 2,
"Celestial Core Crystal": 2,
"Origin Qi Flake": 1,
"Molten Gold Dew": 1,
"True Mist Heart": 1
},
"result": $agilityboostpotion5
}>>
/* ═══════════════════════════════════════
WILLPOWER RECIPES
merchantCost: standard baseline
G1: 300 | G2: 650 | G3: 1200 | G4: 2900 | G5: 5800
═══════════════════════════════════════ */
<<set $willpowerboostrecipe1 to {
"name": "Iron Will Pill (Grade 1)",
"merchantCost": 300,
"ingredients": {
"Cinnabar Heart Stone": 1,
"Empty Mind Herb": 2
},
"result": $willpowerboostpotion1
}>>
<<set $willpowerboostrecipe2 to {
"name": "Iron Will Pill (Grade 2)",
"merchantCost": 650,
"ingredients": {
"Cinnabar Heart Stone": 2,
"Stillwater Pearl Powder": 2,
"Empty Mind Herb": 1,
"Meditation Dust": 1
},
"result": $willpowerboostpotion2
}>>
<<set $willpowerboostrecipe3 to {
"name": "Diamond Mind Pill (Grade 3)",
"merchantCost": 1200,
"ingredients": {
"Stillwater Pearl Powder": 2,
"Moonlit Jade Fragment": 2,
"Cinnabar Heart Stone": 2,
"Refined Spirit Water": 1,
"River Pearl Scale": 1
},
"result": $willpowerboostpotion3
}>>
<<set $willpowerboostrecipe4 to {
"name": "Diamond Mind Pill (Grade 4)",
"merchantCost": 2900,
"ingredients": {
"Soul Mirror Crystal": 2,
"Moonlit Jade Fragment": 2,
"Divine Pulse Stone": 2,
"Stillwater Pearl Powder": 2,
"Astral Dewdrop": 1,
"Heavenly Ember Flower": 1
},
"result": $willpowerboostpotion4
}>>
<<set $willpowerboostrecipe5 to {
"name": "Heaven's Resolve Pill (Grade 5)",
"merchantCost": 5800,
"ingredients": {
"Soul Mirror Crystal": 2,
"Void Meridian Core": 2,
"Astral Dewdrop": 2,
"Moonlit Jade Fragment": 2,
"Qi Dragon Pearl": 2,
"Molten Gold Dew": 1,
"Origin Qi Flake": 1
},
"result": $willpowerboostpotion5
}>>
/* ═══════════════════════════════════════
CHARISMA RECIPES
merchantCost: standard baseline
G1: 280 | G2: 600 | G3: 1150 | G4: 2800
═══════════════════════════════════════ */
/* Grade 1: succubusbreath uses boostCharisma — recipe below */
<<set $succubusbreathrecipe to {
"name": "Succubus Breath Mist",
"merchantCost": 280,
"ingredients": {
"Rose Dew Honey": 2,
"Spirit Vine Tendril": 1
},
"result": $succubusbreath
}>>
<<set $charismaboostrecipe2 to {
"name": "Jade Aura Pill (Grade 2)",
"merchantCost": 600,
"ingredients": {
"Jade Petal Powder": 2,
"Rose Dew Honey": 2,
"Silvertongue Root": 1,
"Clearwater Extract": 1
},
"result": $charismaboostpotion2
}>>
<<set $charismaboostrecipe3 to {
"name": "Phoenix Grace Pill (Grade 3)",
"merchantCost": 1150,
"ingredients": {
"Phoenix Coil Perfume": 2,
"Jade Petal Powder": 2,
"Silvertongue Root": 2,
"Jade Gathering Thread": 1,
"Sunheart Bark": 1
},
"result": $charismaboostpotion3
}>>
<<set $charismaboostrecipe4 to {
"name": "Sovereign Presence Pill (Grade 4)",
"merchantCost": 2800,
"ingredients": {
"Phoenix Coil Perfume": 2,
"Heavenly Ember Flower": 2,
"Silvertongue Root": 2,
"Phoenix Blood Flake": 1,
"Jade Petal Powder": 2,
"Astral Dewdrop": 1
},
"result": $charismaboostpotion4
}>>
/* ═══════════════════════════════════════
LUCK RECIPES
merchantCost: +30-50% premium (unpredictable, hard to source)
G1: 380 | G2: 850 | G3: 1900
═══════════════════════════════════════ */
<<set $luckboostrecipe1 to {
"name": "Fortune Mist Pill (Grade 1)",
"merchantCost": 380,
"ingredients": {
"Fortune Mist Seed": 2,
"Rising Mist Herb": 1
},
"result": $luckboostpotion1
}>>
<<set $luckboostrecipe2 to {
"name": "Fortune Mist Pill (Grade 2)",
"merchantCost": 850,
"ingredients": {
"Fortune Mist Seed": 2,
"Prophet's Eye Flower": 2,
"Moonlight Shell": 1,
"Clearwater Extract": 1
},
"result": $luckboostpotion2
}>>
<<set $luckboostrecipe3 to {
"name": "Heaven's Chosen Pill (Grade 3)",
"merchantCost": 1900,
"ingredients": {
"Destiny Thread Fragment": 2,
"Prophet's Eye Flower": 2,
"Fortune Mist Seed": 2,
"Astral Dewdrop": 1,
"Qi Dragon Pearl": 1,
"Nine Leaf Lotus": 1
},
"result": $luckboostpotion3
}>>
/* ═══════════════════════════════════════
INSIGHT RECIPES
merchantCost: standard baseline
G1: 320 | G2: 700 | G3: 1300
═══════════════════════════════════════ */
<<set $insightboostrecipe1 to {
"name": "Clear Eye Pill (Grade 1)",
"merchantCost": 320,
"ingredients": {
"Prophet's Eye Flower": 1,
"Stone Pulse Pebble": 2
},
"result": $insightboostpotion1
}>>
<<set $insightboostrecipe2 to {
"name": "Clear Eye Pill (Grade 2)",
"merchantCost": 700,
"ingredients": {
"Prophet's Eye Flower": 2,
"Bright Meridian Crystal": 2,
"Stone Pulse Pebble": 1,
"Meditation Dust": 1
},
"result": $insightboostpotion2
}>>
<<set $insightboostrecipe3 to {
"name": "Heaven-Sight Pill (Grade 3)",
"merchantCost": 1300,
"ingredients": {
"Destiny Thread Fragment": 1,
"Prophet's Eye Flower": 2,
"Divine Pulse Stone": 2,
"Bright Meridian Crystal": 2,
"Astral Dewdrop": 1
},
"result": $insightboostpotion3
}>>
/* ═══════════════════════════════════════
MAX HEALTH RECIPES
merchantCost: standard baseline
G1: 270 | G2: 580 | G3: 1100 | G4: 2600
═══════════════════════════════════════ */
<<set $maxhealthrecipe1 to {
"name": "Life Sea Pill (Grade 1)",
"merchantCost": 270,
"ingredients": {
"Green Spirit Sap": 2,
"Vitality Root": 1
},
"result": $maxhealthpotion1
}>>
<<set $maxhealthrecipe2 to {
"name": "Life Sea Pill (Grade 2)",
"merchantCost": 580,
"ingredients": {
"Blood Lotus Petal": 2,
"Green Spirit Sap": 2,
"Ironblood Lotus Seed": 1,
"Blood Hardening Herb": 1
},
"result": $maxhealthpotion2
}>>
<<set $maxhealthrecipe3 to {
"name": "Undying Foundation Pill (Grade 3)",
"merchantCost": 1100,
"ingredients": {
"Heaven Spring Water": 2,
"Blood Lotus Petal": 2,
"Vitality Root": 2,
"Mountain Ox Tendon": 1,
"Dragonbone Dust": 1
},
"result": $maxhealthpotion3
}>>
<<set $maxhealthrecipe4 to {
"name": "Undying Foundation Pill (Grade 4)",
"merchantCost": 2600,
"ingredients": {
"Undying Phoenix Ash": 2,
"Heaven Spring Water": 2,
"Phoenix Blood Flake": 2,
"Blood Lotus Petal": 2,
"Molten Gold Dew": 1,
"Heavenly Ember Flower": 1
},
"result": $maxhealthpotion4
}>>
/* ═══════════════════════════════════════
MAX ENERGY RECIPES
merchantCost: standard baseline
G1: 260 | G2: 560 | G3: 1050 | G4: 2500
═══════════════════════════════════════ */
<<set $maxenergyrecipe1 to {
"name": "Qi Sea Pill (Grade 1)",
"merchantCost": 260,
"ingredients": {
"Faint Qi Crystal": 2,
"Breathing Moon Moss": 1
},
"result": $maxenergypotion1
}>>
<<set $maxenergyrecipe2 to {
"name": "Qi Sea Pill (Grade 2)",
"merchantCost": 560,
"ingredients": {
"Condensed Qi Stone": 2,
"Tidewater Pearl": 1,
"Breathing Moon Moss": 2,
"Qi-Spun Silk": 1
},
"result": $maxenergypotion2
}>>
<<set $maxenergyrecipe3 to {
"name": "Boundless Sea Pill (Grade 3)",
"merchantCost": 1050,
"ingredients": {
"Tidewater Pearl": 2,
"Qi Dragon Pearl": 2,
"Condensed Qi Stone": 2,
"Nine Leaf Lotus": 1,
"Flowroot Essence": 1
},
"result": $maxenergypotion3
}>>
<<set $maxenergyrecipe4 to {
"name": "Boundless Sea Pill (Grade 4)",
"merchantCost": 2500,
"ingredients": {
"Primordial Mist Drop": 2,
"Celestial Core Crystal": 2,
"Voidstorm Tear": 2,
"Tidewater Pearl": 2,
"Origin Qi Flake": 1,
"True Mist Heart": 1
},
"result": $maxenergypotion4
}>>
/* ═══════════════════════════════════════
LIFESPAN RECIPES
merchantCost: +60-100% premium (most coveted category)
G1: 550 | G2: 1400 | G3: 3600
═══════════════════════════════════════ */
<<set $lifespanrecipe1 to {
"name": "Longevity Root Pill (Grade 1)",
"merchantCost": 550,
"ingredients": {
"Ageless Pine Twig": 2,
"Vitality Root": 2
},
"result": $lifespanpotion1
}>>
<<set $lifespanrecipe2 to {
"name": "Immortal Breath Pill (Grade 2)",
"merchantCost": 1400,
"ingredients": {
"Eternal Moon Resin": 2,
"Ageless Pine Twig": 2,
"Heaven Spring Water": 1,
"Nineleaf Lotus": 1,
"Vitality Root": 1
},
"result": $lifespanpotion2
}>>
<<set $lifespanrecipe3 to {
"name": "Heaven Longevity Pill (Grade 3)",
"merchantCost": 3600,
"ingredients": {
"Heaven Longevity Seed": 2,
"Eternal Moon Resin": 2,
"Molten Gold Dew": 1,
"Undying Phoenix Ash": 2,
"Astral Dewdrop": 1,
"Heavenly Ember Flower": 2
},
"result": $lifespanpotion3
}>>
/* ═══════════════════════════════════════
SPIRITUAL ROOT RECIPES
merchantCost: +40-70% premium (sect-level rarity)
G1: 480 | G2: 1000 | G3: 2100 | G4: 5000
═══════════════════════════════════════ */
<<set $spiritrootrecipe1 to {
"name": "Root Nourishing Pill (Grade 1)",
"merchantCost": 480,
"ingredients": {
"Spirit Vine Tendril": 2,
"Faint Qi Crystal": 2
},
"result": $spiritootpotion1
}>>
<<set $spiritrootrecipe2 to {
"name": "Root Nourishing Pill (Grade 2)",
"merchantCost": 1000,
"ingredients": {
"Bright Meridian Crystal": 2,
"Nine Leaf Lotus": 1,
"Spirit Vine Tendril": 2,
"Jade Gathering Thread": 1
},
"result": $spiritrootpotion2
}>>
<<set $spiritrootrecipe3 to {
"name": "Heaven Root Awakening Pill (Grade 3)",
"merchantCost": 2100,
"ingredients": {
"Void Meridian Core": 2,
"Astral Dewdrop": 1,
"Nine Leaf Lotus": 2,
"Bright Meridian Crystal": 2,
"Qi Dragon Pearl": 1
},
"result": $spiritrootpotion3
}>>
<<set $spiritrootrecipe4 to {
"name": "True Heaven Root Pill (Grade 4)",
"merchantCost": 5000,
"ingredients": {
"Void Meridian Core": 2,
"Celestial Core Crystal": 2,
"Origin Qi Flake": 2,
"Heaven-Drawing Ink": 2,
"Qi Dragon Pearl": 2,
"Molten Gold Dew": 1
},
"result": $spiritrootpotion4
}>>
/* ═══════════════════════════════════════
MARTIAL ARTS RECIPES
merchantCost: standard baseline
G1: 300 | G2: 680 | G3: 1350
═══════════════════════════════════════ */
<<set $martialartsrecipe1 to {
"name": "Battle Sense Pill (Grade 1)",
"merchantCost": 300,
"ingredients": {
"Cinnabar Heart Stone": 1,
"Serpent Pulse Salve": 1,
"Meditation Dust": 1
},
"result": $martialartspotionpotion1
}>>
<<set $martialartsrecipe2 to {
"name": "Battle Sense Pill (Grade 2)",
"merchantCost": 680,
"ingredients": {
"Serpent Mark Scale": 1,
"Lightning Step Tendon": 1,
"Cinnabar Heart Stone": 2,
"Inner Flame Core": 1,
"Thunderweed": 1
},
"result": $martialartspotionpotion2
}>>
<<set $martialartsrecipe3 to {
"name": "Unrivalled Form Pill (Grade 3)",
"merchantCost": 1350,
"ingredients": {
"Soul Mirror Crystal": 1,
"Lightning Step Tendon": 2,
"Void Stride Essence": 1,
"Divine Pulse Stone": 2,
"Inner Flame Core": 2,
"Thunderweed": 1
},
"result": $martialartspotionpotion3
}>>
/* ═══════════════════════════════════════
ARMOR RECIPES
merchantCost: common category, slight discount vs baseline
G1: 220 | G2: 480 | G3: 950
═══════════════════════════════════════ */
<<set $armorboostrecipe1 to {
"name": "Iron Skin Pill (Grade 1)",
"merchantCost": 220,
"ingredients": {
"Copper Skin Powder": 2,
"Tempered Bone Fragment": 1
},
"result": $armorboostpotion1
}>>
<<set $armorboostrecipe2 to {
"name": "Iron Skin Pill (Grade 2)",
"merchantCost": 480,
"ingredients": {
"Crimson Hide Flake": 2,
"Thunder Lizard Hide": 2,
"Copper Skin Powder": 1,
"Burning Sand Resin": 1
},
"result": $armorboostpotion2
}>>
<<set $armorboostrecipe3 to {
"name": "Stone Shell Pill (Grade 3)",
"merchantCost": 950,
"ingredients": {
"Thunder Lizard Hide": 2,
"Dragonbone Dust": 2,
"Burning Sand Resin": 2,
"Golden Marrow Fragment": 1,
"Crimson Hide Flake": 1
},
"result": $armorboostpotion3
}>>
/* ═══════════════════════════════════════
CORRUPTION RECIPES
merchantCost: +20-40% premium (forbidden, dangerous to sell)
Most alchemists won't carry these at all — the ones who do charge
for the risk. G1: 280 | G2: 580 | G3: 1100 | G4: 2800 | G5: 5200
═══════════════════════════════════════ */
<<set $corruptionrecipe1 to {
"name": "Tainted Dew Drop",
"merchantCost": 280,
"ingredients": {
"Demonic Qi Dust": 2,
"Heart Devil Weed": 1
},
"result": $corruptionelixir1
}>>
/* Grade 2: corruptionelixir (Heart Demon Nectar) */
<<set $corruptionrecipe2 to {
"name": "Heart Demon Nectar",
"merchantCost": 580,
"ingredients": {
"Heart Devil Weed": 2,
"Dusk Blood Moss": 2,
"Demonic Qi Dust": 1,
"Shadow Lust Pollen": 1
},
"result": $corruptionelixir
}>>
/* Grade 3: forbiddenyangseed (Forbidden Yang Seed) */
<<set $corruptionrecipe3 to {
"name": "Forbidden Yang Seed",
"merchantCost": 1100,
"ingredients": {
"Shadow Lust Pollen": 2,
"Demon Bile Extract": 2,
"Heart Devil Weed": 2,
"Taboo Flesh Seal": 1
},
"result": $forbiddenyangseed
}>>
<<set $corruptionrecipe4 to {
"name": "Abyss Communion Draft",
"merchantCost": 2800,
"ingredients": {
"Abyssal Heart Core": 2,
"Sin Flesh Powder": 2,
"Taboo Flesh Seal": 2,
"Demon Bile Extract": 2,
"Void Corruption Tear": 1
},
"result": $corruptionelixir4
}>>
<<set $corruptionrecipe5 to {
"name": "Void Demon Ascension Elixir",
"merchantCost": 5200,
"ingredients": {
"Void Corruption Tear": 2,
"Abyssal Heart Core": 2,
"Sin Flesh Powder": 2,
"Shadow Lust Pollen": 2,
"Demon Bile Extract": 2,
"Heart Devil Weed": 2
},
"result": $corruptionelixir5
}>><<set $strengthboostpotion1 to {
"id": "strengthboostpotion1",
"name": "Strength Boost Pill (Grade 1)",
"description": "Temporarily boosts strength. Grade 1 effective up to STR 15.",
"effect": "boostStrength",
"grade": 1,
"maxStatLimit": 15,
"quantity": 1,
"class": "potion",
"price": 150,
"sellprice": 60,
"tag": "Strength"
}>>
<<set $corruptionelixir to {
"id": "corruptionelixir",
"name": "Heart Demon Nectar",
"description": "Sweet demonic essence that loosens moral restraints and awakens hidden desires. Slightly increases demonic path affinity.",
"effect": "raiseCorruption",
"grade": 2,
"maxStatLimit": 0,
"quantity": 1,
"class": "potion",
"price": 300,
"sellprice": 75,
"tag": "Corruption"
}>>
<<set $succubusbreath to {
"id": "succubusbreath",
"name": "Succubus Breath Mist",
"description": "Inhaled vapors that temporarily heighten charm and make your voice more seductive. Others find it hard to refuse you.",
"effect": "boostCharisma",
"grade": 1,
"maxStatLimit": 20,
"quantity": 1,
"class": "potion",
"price": 250,
"sellprice": 62,
"tag": "Charisma"
}>>
<<set $forbiddenyangseed to {
"id": "forbiddenyangseed",
"name": "Forbidden Yang Seed",
"description": "A single drop of concentrated yang essence. Greatly increases corruption and demonic tendencies over time.",
"effect": "deepCorruption",
"grade": 3,
"maxStatLimit": 0,
"quantity": 1,
"class": "potion",
"price": 500,
"sellprice": 125,
"tag": "Corruption"
}>>
/* ═══════════════════════════════════════════
STRENGTH POTIONS — Grades 1–5
═══════════════════════════════════════════ */
/* Grade 1 already exists: $strengthboostpotion1 */
<<set $strengthboostpotion2 to {
"id": "strengthboostpotion2",
"name": "Strength Boost Pill (Grade 2)",
"description": "Hardens muscle and bone, permanently improving physical power. Grade 2 effective up to STR 25.",
"effect": "boostStrength",
"grade": 2,
"maxStatLimit": 25,
"quantity": 1,
"class": "potion",
"price": 280,
"sellprice": 112,
"tag": "Strength"
}>>
<<set $strengthboostpotion3 to {
"id": "strengthboostpotion3",
"name": "Strength Boost Pill (Grade 3)",
"description": "Reshapes the cultivator's musculature at a deep level. Grade 3 effective up to STR 40.",
"effect": "boostStrength",
"grade": 3,
"maxStatLimit": 40,
"quantity": 1,
"class": "potion",
"price": 500,
"sellprice": 200,
"tag": "Strength"
}>>
<<set $strengthboostpotion4 to {
"id": "strengthboostpotion4",
"name": "Strength Boost Pill (Grade 4)",
"description": "A rare pill that tempers the body to near-spirit beast levels. Grade 4 effective up to STR 60.",
"effect": "boostStrength",
"grade": 4,
"maxStatLimit": 60,
"quantity": 1,
"class": "potion",
"price": 900,
"sellprice": 360,
"tag": "Strength"
}>>
<<set $strengthboostpotion5 to {
"id": "strengthboostpotion5",
"name": "Strength Boost Pill (Grade 5)",
"description": "A heavenly pill said to grant the strength of an ancient divine beast. Grade 5 effective up to STR 80.",
"effect": "boostStrength",
"grade": 5,
"maxStatLimit": 80,
"quantity": 1,
"class": "potion",
"price": 2000,
"sellprice": 800,
"tag": "Strength"
}>>
/* ═══════════════════════════════════════════
AGILITY POTIONS — Grades 1–5
═══════════════════════════════════════════ */
<<set $agilityboostpotion1 to {
"id": "agilityboostpotion1",
"name": "Wind Step Pill (Grade 1)",
"description": "Lightens the body and quickens footwork. Grade 1 effective up to AGI 15.",
"effect": "boostAgility",
"grade": 1,
"maxStatLimit": 15,
"quantity": 1,
"class": "potion",
"price": 140,
"sellprice": 56,
"tag": "Agility"
}>>
<<set $agilityboostpotion2 to {
"id": "agilityboostpotion2",
"name": "Wind Step Pill (Grade 2)",
"description": "Refines limb response and body coordination. Grade 2 effective up to AGI 25.",
"effect": "boostAgility",
"grade": 2,
"maxStatLimit": 25,
"quantity": 1,
"class": "potion",
"price": 270,
"sellprice": 108,
"tag": "Agility"
}>>
<<set $agilityboostpotion3 to {
"id": "agilityboostpotion3",
"name": "Wind Step Pill (Grade 3)",
"description": "Infuses the meridians with wind qi, enabling near-instantaneous movement. Grade 3 effective up to AGI 40.",
"effect": "boostAgility",
"grade": 3,
"maxStatLimit": 40,
"quantity": 1,
"class": "potion",
"price": 480,
"sellprice": 192,
"tag": "Agility"
}>>
<<set $agilityboostpotion4 to {
"id": "agilityboostpotion4",
"name": "Void Stride Pill (Grade 4)",
"description": "Partially decouples the body from physical space during movement. Grade 4 effective up to AGI 60.",
"effect": "boostAgility",
"grade": 4,
"maxStatLimit": 60,
"quantity": 1,
"class": "potion",
"price": 950,
"sellprice": 380,
"tag": "Agility"
}>>
<<set $agilityboostpotion5 to {
"id": "agilityboostpotion5",
"name": "Void Stride Pill (Grade 5)",
"description": "The pinnacle of movement refinement. Recipients move as though skimming through dreams. Grade 5 effective up to AGI 80.",
"effect": "boostAgility",
"grade": 5,
"maxStatLimit": 80,
"quantity": 1,
"class": "potion",
"price": 2200,
"sellprice": 880,
"tag": "Agility"
}>>
/* ═══════════════════════════════════════════
WILLPOWER POTIONS — Grades 1–5
═══════════════════════════════════════════ */
<<set $willpowerboostpotion1 to {
"id": "willpowerboostpotion1",
"name": "Iron Will Pill (Grade 1)",
"description": "Tempers the mind and steadies the spirit. Grade 1 effective up to WIL 15.",
"effect": "boostWillpower",
"grade": 1,
"maxStatLimit": 15,
"quantity": 1,
"class": "potion",
"price": 145,
"sellprice": 58,
"tag": "Willpower"
}>>
<<set $willpowerboostpotion2 to {
"id": "willpowerboostpotion2",
"name": "Iron Will Pill (Grade 2)",
"description": "Reinforces mental barriers and deepens meditative focus. Grade 2 effective up to WIL 25.",
"effect": "boostWillpower",
"grade": 2,
"maxStatLimit": 25,
"quantity": 1,
"class": "potion",
"price": 275,
"sellprice": 110,
"tag": "Willpower"
}>>
<<set $willpowerboostpotion3 to {
"id": "willpowerboostpotion3",
"name": "Diamond Mind Pill (Grade 3)",
"description": "Crystallizes the cultivator's resolve into an unshakeable pillar. Grade 3 effective up to WIL 40.",
"effect": "boostWillpower",
"grade": 3,
"maxStatLimit": 40,
"quantity": 1,
"class": "potion",
"price": 500,
"sellprice": 200,
"tag": "Willpower"
}>>
<<set $willpowerboostpotion4 to {
"id": "willpowerboostpotion4",
"name": "Diamond Mind Pill (Grade 4)",
"description": "The mind becomes a fortress. Heart demons cannot gain purchase. Grade 4 effective up to WIL 60.",
"effect": "boostWillpower",
"grade": 4,
"maxStatLimit": 60,
"quantity": 1,
"class": "potion",
"price": 960,
"sellprice": 384,
"tag": "Willpower"
}>>
<<set $willpowerboostpotion5 to {
"id": "willpowerboostpotion5",
"name": "Heaven's Resolve Pill (Grade 5)",
"description": "A legendary pill said to grant the unwavering will of an immortal. Grade 5 effective up to WIL 80.",
"effect": "boostWillpower",
"grade": 5,
"maxStatLimit": 80,
"quantity": 1,
"class": "potion",
"price": 2100,
"sellprice": 840,
"tag": "Willpower"
}>>
/* ═══════════════════════════════════════════
CHARISMA POTIONS — Grades 1–4
(existing Grade 1: succubusbreath uses boostCharisma)
═══════════════════════════════════════════ */
<<set $charismaboostpotion2 to {
"id": "charismaboostpotion2",
"name": "Jade Aura Pill (Grade 2)",
"description": "Refines manner and bearing. Others instinctively trust and admire you. Grade 2 effective up to CHA 25.",
"effect": "boostCharisma",
"grade": 2,
"maxStatLimit": 25,
"quantity": 1,
"class": "potion",
"price": 280,
"sellprice": 112,
"tag": "Charisma"
}>>
<<set $charismaboostpotion3 to {
"id": "charismaboostpotion3",
"name": "Phoenix Grace Pill (Grade 3)",
"description": "Grants an imperious radiance that commands respect across social boundaries. Grade 3 effective up to CHA 40.",
"effect": "boostCharisma",
"grade": 3,
"maxStatLimit": 40,
"quantity": 1,
"class": "potion",
"price": 520,
"sellprice": 208,
"tag": "Charisma"
}>>
<<set $charismaboostpotion4 to {
"id": "charismaboostpotion4",
"name": "Sovereign Presence Pill (Grade 4)",
"description": "A pill reserved for those walking the path of kings. Your very presence silences rooms. Grade 4 effective up to CHA 60.",
"effect": "boostCharisma",
"grade": 4,
"maxStatLimit": 60,
"quantity": 1,
"class": "potion",
"price": 1000,
"sellprice": 400,
"tag": "Charisma"
}>>
/* ═══════════════════════════════════════════
LUCK POTIONS — Grades 1–3
═══════════════════════════════════════════ */
<<set $luckboostpotion1 to {
"id": "luckboostpotion1",
"name": "Fortune Mist Pill (Grade 1)",
"description": "Slightly shifts fate in your favor. Small blessings accumulate. Grade 1 effective up to LCK 15.",
"effect": "boostLuck",
"grade": 1,
"maxStatLimit": 15,
"quantity": 1,
"class": "potion",
"price": 200,
"sellprice": 80,
"tag": "Luck"
}>>
<<set $luckboostpotion2 to {
"id": "luckboostpotion2",
"name": "Fortune Mist Pill (Grade 2)",
"description": "Fate threads itself around the user. Coincidences become meaningful. Grade 2 effective up to LCK 25.",
"effect": "boostLuck",
"grade": 2,
"maxStatLimit": 25,
"quantity": 1,
"class": "potion",
"price": 450,
"sellprice": 180,
"tag": "Luck"
}>>
<<set $luckboostpotion3 to {
"id": "luckboostpotion3",
"name": "Heaven's Chosen Pill (Grade 3)",
"description": "Heaven itself seems to smile. Enemies stumble, treasures appear, and escape routes open. Grade 3 effective up to LCK 40.",
"effect": "boostLuck",
"grade": 3,
"maxStatLimit": 40,
"quantity": 1,
"class": "potion",
"price": 850,
"sellprice": 340,
"tag": "Luck"
}>>
/* ═══════════════════════════════════════════
INSIGHT POTIONS — Grades 1–3
═══════════════════════════════════════════ */
<<set $insightboostpotion1 to {
"id": "insightboostpotion1",
"name": "Clear Eye Pill (Grade 1)",
"description": "Sharpens perception and broadens spatial awareness. Grade 1 effective up to INS 15.",
"effect": "boostInsight",
"grade": 1,
"maxStatLimit": 15,
"quantity": 1,
"class": "potion",
"price": 190,
"sellprice": 76,
"tag": "Insight"
}>>
<<set $insightboostpotion2 to {
"id": "insightboostpotion2",
"name": "Clear Eye Pill (Grade 2)",
"description": "Expands the cultivator's sense of the battlefield. Reading intent becomes instinctive. Grade 2 effective up to INS 25.",
"effect": "boostInsight",
"grade": 2,
"maxStatLimit": 25,
"quantity": 1,
"class": "potion",
"price": 420,
"sellprice": 168,
"tag": "Insight"
}>>
<<set $insightboostpotion3 to {
"id": "insightboostpotion3",
"name": "Heaven-Sight Pill (Grade 3)",
"description": "Sight and mind fuse into something beyond normal perception. Grade 3 effective up to INS 40.",
"effect": "boostInsight",
"grade": 3,
"maxStatLimit": 40,
"quantity": 1,
"class": "potion",
"price": 800,
"sellprice": 320,
"tag": "Insight"
}>>
/* ═══════════════════════════════════════════
MAX HEALTH POTIONS — Grades 1–4
═══════════════════════════════════════════ */
<<set $maxhealthpotion1 to {
"id": "maxhealthpotion1",
"name": "Life Sea Pill (Grade 1)",
"description": "Expands the body's life force reserves. Grade 1 effective up to MaxHP 400.",
"effect": "boostMaxHealth",
"grade": 1,
"maxStatLimit": 400,
"quantity": 1,
"class": "potion",
"price": 160,
"sellprice": 64,
"tag": "Health"
}>>
<<set $maxhealthpotion2 to {
"id": "maxhealthpotion2",
"name": "Life Sea Pill (Grade 2)",
"description": "Deepens the life sea through blood and marrow refinement. Grade 2 effective up to MaxHP 600.",
"effect": "boostMaxHealth",
"grade": 2,
"maxStatLimit": 600,
"quantity": 1,
"class": "potion",
"price": 330,
"sellprice": 132,
"tag": "Health"
}>>
<<set $maxhealthpotion3 to {
"id": "maxhealthpotion3",
"name": "Undying Foundation Pill (Grade 3)",
"description": "Restructures the foundation of life itself. Grade 3 effective up to MaxHP 900.",
"effect": "boostMaxHealth",
"grade": 3,
"maxStatLimit": 900,
"quantity": 1,
"class": "potion",
"price": 650,
"sellprice": 260,
"tag": "Health"
}>>
<<set $maxhealthpotion4 to {
"id": "maxhealthpotion4",
"name": "Undying Foundation Pill (Grade 4)",
"description": "The body becomes a vessel capable of holding a near-divine amount of life energy. Grade 4 effective up to MaxHP 1400.",
"effect": "boostMaxHealth",
"grade": 4,
"maxStatLimit": 1400,
"quantity": 1,
"class": "potion",
"price": 1400,
"sellprice": 560,
"tag": "Health"
}>>
/* ═══════════════════════════════════════════
MAX ENERGY POTIONS — Grades 1–4
═══════════════════════════════════════════ */
<<set $maxenergypotion1 to {
"id": "maxenergypotion1",
"name": "Qi Sea Pill (Grade 1)",
"description": "Widens the cultivator's energy meridians, allowing more qi to circulate. Grade 1 effective up to MaxEnergy 300.",
"effect": "boostMaxEnergy",
"grade": 1,
"maxStatLimit": 300,
"quantity": 1,
"class": "potion",
"price": 155,
"sellprice": 62,
"tag": "Energy"
}>>
<<set $maxenergypotion2 to {
"id": "maxenergypotion2",
"name": "Qi Sea Pill (Grade 2)",
"description": "Opens secondary meridian pathways, greatly increasing energy capacity. Grade 2 effective up to MaxEnergy 500.",
"effect": "boostMaxEnergy",
"grade": 2,
"maxStatLimit": 500,
"quantity": 1,
"class": "potion",
"price": 320,
"sellprice": 128,
"tag": "Energy"
}>>
<<set $maxenergypotion3 to {
"id": "maxenergypotion3",
"name": "Boundless Sea Pill (Grade 3)",
"description": "Cultivator's energy sea expands to rival that of a core-stage elder. Grade 3 effective up to MaxEnergy 800.",
"effect": "boostMaxEnergy",
"grade": 3,
"maxStatLimit": 800,
"quantity": 1,
"class": "potion",
"price": 600,
"sellprice": 240,
"tag": "Energy"
}>>
<<set $maxenergypotion4 to {
"id": "maxenergypotion4",
"name": "Boundless Sea Pill (Grade 4)",
"description": "The energy sea becomes an ocean without horizon. Grade 4 effective up to MaxEnergy 1200.",
"effect": "boostMaxEnergy",
"grade": 4,
"maxStatLimit": 1200,
"quantity": 1,
"class": "potion",
"price": 1350,
"sellprice": 540,
"tag": "Energy"
}>>
/* ═══════════════════════════════════════════
LIFESPAN POTIONS — Grades 1–3
═══════════════════════════════════════════ */
<<set $lifespanpotion1 to {
"id": "lifespanpotion1",
"name": "Longevity Root Pill (Grade 1)",
"description": "Slows cellular decay at the qi level. Adds modest years to maximum lifespan.",
"effect": "boostLifespan",
"grade": 1,
"maxStatLimit": 0,
"quantity": 1,
"class": "potion",
"price": 350,
"sellprice": 140,
"tag": "Lifespan"
}>>
<<set $lifespanpotion2 to {
"id": "lifespanpotion2",
"name": "Immortal Breath Pill (Grade 2)",
"description": "Refines the body's time-essence, granting a meaningful extension to one's natural span.",
"effect": "boostLifespan",
"grade": 2,
"maxStatLimit": 0,
"quantity": 1,
"class": "potion",
"price": 700,
"sellprice": 280,
"tag": "Lifespan"
}>>
<<set $lifespanpotion3 to {
"id": "lifespanpotion3",
"name": "Heaven Longevity Pill (Grade 3)",
"description": "Said to add centuries when taken by a high-realm cultivator. The pinnacle of life-extending alchemy.",
"effect": "boostLifespan",
"grade": 3,
"maxStatLimit": 0,
"quantity": 1,
"class": "potion",
"price": 1800,
"sellprice": 720,
"tag": "Lifespan"
}>>
/* ═══════════════════════════════════════════
SPIRITUAL ROOT POTIONS — Grades 1–4
═══════════════════════════════════════════ */
<<set $spiritootpotion1 to {
"id": "spiritootpotion1",
"name": "Root Nourishing Pill (Grade 1)",
"description": "Nourishes the spiritual root to improve natural qi absorption rate. Grade 1 effective up to SR 15.",
"effect": "boostSpiritualRoot",
"grade": 1,
"maxStatLimit": 15,
"quantity": 1,
"class": "potion",
"price": 200,
"sellprice": 80,
"tag": "SpiritualRoot"
}>>
<<set $spiritrootpotion2 to {
"id": "spiritrootpotion2",
"name": "Root Nourishing Pill (Grade 2)",
"description": "Deepens the spiritual root's connection to heaven and earth. Grade 2 effective up to SR 30.",
"effect": "boostSpiritualRoot",
"grade": 2,
"maxStatLimit": 30,
"quantity": 1,
"class": "potion",
"price": 420,
"sellprice": 168,
"tag": "SpiritualRoot"
}>>
<<set $spiritrootpotion3 to {
"id": "spiritrootpotion3",
"name": "Heaven Root Awakening Pill (Grade 3)",
"description": "Purges blockages in the spiritual root, allowing hidden talent to emerge. Grade 3 effective up to SR 50.",
"effect": "boostSpiritualRoot",
"grade": 3,
"maxStatLimit": 50,
"quantity": 1,
"class": "potion",
"price": 850,
"sellprice": 340,
"tag": "SpiritualRoot"
}>>
<<set $spiritrootpotion4 to {
"id": "spiritrootpotion4",
"name": "True Heaven Root Pill (Grade 4)",
"description": "Restructures the user's innate talent at its source. Coveted by entire sects. Grade 4 effective up to SR 70.",
"effect": "boostSpiritualRoot",
"grade": 4,
"maxStatLimit": 70,
"quantity": 1,
"class": "potion",
"price": 2000,
"sellprice": 800,
"tag": "SpiritualRoot"
}>>
/* ═══════════════════════════════════════════
MARTIAL ARTS POTIONS — Grades 1–3
═══════════════════════════════════════════ */
<<set $martialartspotionpotion1 to {
"id": "martialartspotionpotion1",
"name": "Battle Sense Pill (Grade 1)",
"description": "Refines combat instincts and improves technique retention. Grade 1 effective up to MA 20.",
"effect": "boostMartialArts",
"grade": 1,
"maxStatLimit": 20,
"quantity": 1,
"class": "potion",
"price": 180,
"sellprice": 72,
"tag": "MartialArts"
}>>
<<set $martialartspotionpotion2 to {
"id": "martialartspotionpotion2",
"name": "Battle Sense Pill (Grade 2)",
"description": "Sharpens combat flow, allowing techniques to chain naturally during battle. Grade 2 effective up to MA 35.",
"effect": "boostMartialArts",
"grade": 2,
"maxStatLimit": 35,
"quantity": 1,
"class": "potion",
"price": 400,
"sellprice": 160,
"tag": "MartialArts"
}>>
<<set $martialartspotionpotion3 to {
"id": "martialartspotionpotion3",
"name": "Unrivalled Form Pill (Grade 3)",
"description": "Engraves perfect martial memory into the body. Mistakes become impossible during peak performance. Grade 3 effective up to MA 55.",
"effect": "boostMartialArts",
"grade": 3,
"maxStatLimit": 55,
"quantity": 1,
"class": "potion",
"price": 900,
"sellprice": 360,
"tag": "MartialArts"
}>>
/* ═══════════════════════════════════════════
CORRUPTION POTIONS — Grades 1–5
(Grade 2: corruptionelixir and Grade 3: forbiddenyangseed already exist)
═══════════════════════════════════════════ */
<<set $corruptionelixir1 to {
"id": "corruptionelixir1",
"name": "Tainted Dew Drop",
"description": "A faint mist of demonic qi condensed into liquid. The first step down a dangerous road. Slightly raises corruption.",
"effect": "raiseCorruption",
"grade": 1,
"maxStatLimit": 0,
"quantity": 1,
"class": "potion",
"price": 120,
"sellprice": 30,
"tag": "Corruption"
}>>
/* Grade 2 is $corruptionelixir (Heart Demon Nectar) */
/* Grade 3 is $forbiddenyangseed (Forbidden Yang Seed) */
<<set $corruptionelixir4 to {
"id": "corruptionelixir4",
"name": "Abyss Communion Draft",
"description": "Binds a fragment of demonic will to the cultivator's spirit. A point of no return for many. Greatly raises corruption.",
"effect": "deepCorruption",
"grade": 4,
"maxStatLimit": 0,
"quantity": 1,
"class": "potion",
"price": 800,
"sellprice": 200,
"tag": "Corruption"
}>>
<<set $corruptionelixir5 to {
"id": "corruptionelixir5",
"name": "Void Demon Ascension Elixir",
"description": "The pinnacle of dark alchemy. Permanently fuses demonic essence into the cultivator's core. Catastrophically raises corruption.",
"effect": "deepCorruption",
"grade": 5,
"maxStatLimit": 0,
"quantity": 1,
"class": "potion",
"price": 1500,
"sellprice": 375,
"tag": "Corruption"
}>>
/* ═══════════════════════════════════════════
DEFENSE / ARMOR POTIONS — Grades 1–3
═══════════════════════════════════════════ */
<<set $armorboostpotion1 to {
"id": "armorboostpotion1",
"name": "Iron Skin Pill (Grade 1)",
"description": "Hardens the outer body, reducing the impact of strikes. Grade 1 effective up to ARM 10.",
"effect": "boostArmor",
"grade": 1,
"maxStatLimit": 10,
"quantity": 1,
"class": "potion",
"price": 130,
"sellprice": 52,
"tag": "Armor"
}>>
<<set $armorboostpotion2 to {
"id": "armorboostpotion2",
"name": "Iron Skin Pill (Grade 2)",
"description": "Layers the skin with qi-infused mineral essence. Grade 2 effective up to ARM 20.",
"effect": "boostArmor",
"grade": 2,
"maxStatLimit": 20,
"quantity": 1,
"class": "potion",
"price": 300,
"sellprice": 120,
"tag": "Armor"
}>>
<<set $armorboostpotion3 to {
"id": "armorboostpotion3",
"name": "Stone Shell Pill (Grade 3)",
"description": "The cultivator's outer body approaches the hardness of a spirit beast's natural armor. Grade 3 effective up to ARM 35.",
"effect": "boostArmor",
"grade": 3,
"maxStatLimit": 35,
"quantity": 1,
"class": "potion",
"price": 600,
"sellprice": 240,
"tag": "Armor"
}>><<BackgroundHandler>>
You carefully kneel and begin collecting the herbs, taking care not to damage their roots.
Their scent is invigorating, and you can already imagine the pills or elixirs they might produce.
<<gainRandomItem>>
You've found <<print _item.name>>!
<<return "Go back">><<set $temperedbonefragment to {"name": "Tempered Bone Fragment", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 40, "tripleprice": 120, "sellprice": 12, "class": "item", "quantity": 0, "description": "Beast bone used to toughen the body.", "id": "temperedbonefragment"}>>
<<set $bodyforgingelixir to {"name": "Body Forging Elixir", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 50, "tripleprice": 150, "sellprice": 15, "class": "item", "quantity": 0, "description": "Strengthens muscles during training.", "id": "bodyforgingelixir"}>>
<<set $copperskinpowder to {"name": "Copper Skin Powder", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 45, "tripleprice": 135, "sellprice": 13, "class": "item", "quantity": 0, "description": "Boosts external durability for beginners.", "id": "copperskinpowder"}>>
<<set $bloodhardeningherb to {"name": "Blood Hardening Herb", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 55, "tripleprice": 165, "sellprice": 16, "class": "item", "quantity": 0, "description": "Thickens blood, reinforcing organs.", "id": "bloodhardeningherb"}>>
<<set $sturdygrassfiber to {"name": "Sturdy Grass Fiber", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 35, "tripleprice": 105, "sellprice": 10, "class": "item", "quantity": 0, "description": "Used in martial body rituals.", "id": "sturdygrassfiber"}>>
<<set $ironbloodlotusseed to {"name": "Ironblood Lotus Seed", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 90, "tripleprice": 270, "sellprice": 27, "class": "item", "quantity": 0, "description": "A seed that fortifies bone and blood.", "id": "ironbloodlotusseed"}>>
<<set $mountainoxtendon to {"name": "Mountain Ox Tendon", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 100, "tripleprice": 300, "sellprice": 30, "class": "item", "quantity": 0, "description": "Contains essence to improve muscle density.", "id": "mountainoxtendon"}>>
<<set $crimsonhideflake to {"name": "Crimson Hide Flake", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 85, "tripleprice": 255, "sellprice": 25, "class": "item", "quantity": 0, "description": "From beasts known for tough hides.", "id": "crimsonhideflake"}>>
<<set $vitalityroot to {"name": "Vitality Root", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 95, "tripleprice": 285, "sellprice": 28, "class": "item", "quantity": 0, "description": "Improves endurance and physical resilience.", "id": "vitalityroot"}>>
<<set $burningsandresin to {"name": "Burning Sand Resin", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 80, "tripleprice": 240, "sellprice": 24, "class": "item", "quantity": 0, "description": "Mixed into pills for body forging.", "id": "burningsandresin"}>>
<<set $dragonbonedust to {"name": "Dragonbone Dust", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 150, "tripleprice": 450, "sellprice": 45, "class": "item", "quantity": 0, "description": "Legendary dust said to make skin unbreakable.", "id": "dragonbonedust"}>>
<<set $moltengolddew to {"name": "Molten Gold Dew", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 400, "tripleprice": 1200, "sellprice": 360, "class": "item", "quantity": 0, "description": "Rare liquid said to rebuild the body.", "id": "moltengolddew"}>>
<<set $titanapehair to {"name": "Titan Ape Hair", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 155, "tripleprice": 465, "sellprice": 46, "class": "item", "quantity": 0, "description": "Imbues user with great physical strength.", "id": "titanapehair"}>>
<<set $heavenlyemberflower to {"name": "Heavenly Ember Flower", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 165, "tripleprice": 495, "sellprice": 49, "class": "item", "quantity": 0, "description": "Used in heavenly-grade body pills.", "id": "heavenlyemberflower"}>>
<<set $phoenixbloodflake to {"name": "Phoenix Blood Flake", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 170, "tripleprice": 510, "sellprice": 51, "class": "item", "quantity": 0, "description": "Reshapes mortal frame to near-divine.", "id": "phoenixbloodflake"}>>
<<set $spiritvinetendril to {"name": "Spirit Vine Tendril", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 45, "tripleprice": 135, "sellprice": 13, "class": "item", "quantity": 0, "description": "Mildly stimulates meridian activity.", "id": "spiritvinetendril"}>>
<<set $qispunsilk to {"name": "Qi-Spun Silk", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 40, "tripleprice": 120, "sellprice": 12, "class": "item", "quantity": 0, "description": "Enhances energy circulation slightly.", "id": "qispunsilk"}>>
<<set $stonepulsepebble to {"name": "Stone Pulse Pebble", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 50, "tripleprice": 150, "sellprice": 15, "class": "item", "quantity": 0, "description": "Used in meditative formations.", "id": "stonepulsepebble"}>>
<<set $clearwaterextract to {"name": "Clearwater Extract", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 55, "tripleprice": 165, "sellprice": 16, "class": "item", "quantity": 0, "description": "Flushes impurities from meridians.", "id": "clearwaterextract"}>>
<<set $lessermeridiandust to {"name": "Lesser Meridian Dust", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 35, "tripleprice": 105, "sellprice": 10, "class": "item", "quantity": 0, "description": "Base material for opening pill recipes.", "id": "lessermeridiandust"}>>
<<set $brightmeridiancrystal to {"name": "Bright Meridian Crystal", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 95, "tripleprice": 285, "sellprice": 28, "class": "item", "quantity": 0, "description": "Directly enhances inner flow.", "id": "brightmeridiancrystal"}>>
<<set $serpentpulsesalve to {"name": "Serpent Pulse Salve", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 90, "tripleprice": 270, "sellprice": 27, "class": "item", "quantity": 0, "description": "Used to ease meridian blockages.", "id": "serpentpulsesalve"}>>
<<set $thunderweed to {"name": "Thunderweed", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 85, "tripleprice": 255, "sellprice": 25, "class": "item", "quantity": 0, "description": "Stimulates qi flow violently.", "id": "thunderweed"}>>
<<set $moonlightshell to {"name": "Moonlight Shell", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 100, "tripleprice": 300, "sellprice": 30, "class": "item", "quantity": 0, "description": "Cools and soothes energy pathways.", "id": "moonlightshell"}>>
<<set $nineleaflotus to {"name": "Nineleaf Lotus", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 105, "tripleprice": 315, "sellprice": 31, "class": "item", "quantity": 0, "description": "Refines and strengthens core meridians.", "id": "nineleaflotus"}>>
<<set $divinepulsestone to {"name": "Divine Pulse Stone", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 160, "tripleprice": 480, "sellprice": 48, "class": "item", "quantity": 0, "description": "Used by ancient sects for breakthroughs.", "id": "divinepulsestone"}>>
<<set $astraldewdrop to {"name": "Astral Dewdrop", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 170, "tripleprice": 510, "sellprice": 51, "class": "item", "quantity": 0, "description": "Mythical water for meridian clarity.", "id": "astraldewdrop"}>>
<<set $qidragonpearl to {"name": "Qi Dragon Pearl", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 175, "tripleprice": 525, "sellprice": 52, "class": "item", "quantity": 0, "description": "Enhances all internal channels.", "id": "qidragonpearl"}>>
<<set $voidmeridiancore to {"name": "Void Meridian Core", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 165, "tripleprice": 495, "sellprice": 49, "class": "item", "quantity": 0, "description": "Said to awaken even dormant talents.", "id": "voidmeridiancore"}>>
<<set $sunheartbark to {"name": "Sunheart Bark", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 155, "tripleprice": 465, "sellprice": 46, "class": "item", "quantity": 0, "description": "Generates warmth that spreads through body.", "id": "sunheartbark"}>>
<<set $faintqicrystal to {"name": "Faint Qi Crystal", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 50, "tripleprice": 150, "sellprice": 15, "class": "item", "quantity": 0, "description": "Can be absorbed by beginners.", "id": "faintqicrystal"}>>
<<set $meditationdust to {"name": "Meditation Dust", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 45, "tripleprice": 135, "sellprice": 13, "class": "item", "quantity": 0, "description": "Improves focus during breakthrough.", "id": "meditationdust"}>>
<<set $refinedspiritwater to {"name": "Refined Spirit Water", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 55, "tripleprice": 165, "sellprice": 16, "class": "item", "quantity": 0, "description": "Helps stabilize internal energy.", "id": "refinedspiritwater"}>>
<<set $crackedflowcharm to {"name": "Cracked Flow Charm", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 40, "tripleprice": 120, "sellprice": 12, "class": "item", "quantity": 0, "description": "Still carries usable qi patterns.", "id": "crackedflowcharm"}>>
<<set $risingmistherb to {"name": "Rising Mist Herb", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 35, "tripleprice": 105, "sellprice": 10, "class": "item", "quantity": 0, "description": "Mildly enhances energy cohesion.", "id": "risingmistherb"}>>
<<set $condensedqistone to {"name": "Condensed Qi Stone", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 95, "tripleprice": 285, "sellprice": 28, "class": "item", "quantity": 0, "description": "Holds stable, purified energy.", "id": "condensedqistone"}>>
<<set $jadegatheringthread to {"name": "Jade Gathering Thread", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 100, "tripleprice": 300, "sellprice": 30, "class": "item", "quantity": 0, "description": "Conducts energy smoothly during training.", "id": "jadegatheringthread"}>>
<<set $flowrootessence to {"name": "Flowroot Essence", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 90, "tripleprice": 270, "sellprice": 27, "class": "item", "quantity": 0, "description": "Draws external energy inward.", "id": "flowrootessence"}>>
<<set $innerflamecore to {"name": "Inner Flame Core", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 85, "tripleprice": 255, "sellprice": 25, "class": "item", "quantity": 0, "description": "Improves inner condensation quality.", "id": "innerflamecore"}>>
<<set $windveinpowder to {"name": "Wind Vein Powder", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 105, "tripleprice": 315, "sellprice": 31, "class": "item", "quantity": 0, "description": "Boosts spiraling qi motion.", "id": "windveinpowder"}>>
<<set $voidstormtear to {"name": "Voidstorm Tear", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 180, "tripleprice": 540, "sellprice": 54, "class": "item", "quantity": 0, "description": "Used to condense divine-quality qi.", "id": "voidstormtear"}>>
<<set $celestialcorecrystal to {"name": "Celestial Core Crystal", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 190, "tripleprice": 570, "sellprice": 57, "class": "item", "quantity": 0, "description": "Pulsates with raw elemental energy.", "id": "celestialcorecrystal"}>>
<<set $heavendrawingink to {"name": "Heaven-Drawing Ink", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 170, "tripleprice": 510, "sellprice": 51, "class": "item", "quantity": 0, "description": "Used in inscriptions to reshape qi.", "id": "heavendrawingink"}>>
<<set $originqiflake to {"name": "Origin Qi Flake", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 175, "tripleprice": 525, "sellprice": 52, "class": "item", "quantity": 0, "description": "Contains untouched universal energy.", "id": "originqiflake"}>>
<<set $truemistheart to {"name": "True Mist Heart", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 185, "tripleprice": 555, "sellprice": 55, "class": "item", "quantity": 0, "description": "Condenses all surrounding energies into user.", "id": "truemistheart"}>>
<<set $riverpearlscale to {
"name": "River Pearl Scale",
"strength": 0,
"agility": 0,
"willpower": 2,
"armor": 5,
"health": 0,
"energy": 0,
"evadescore": 0,
"price": 120,
"tripleprice": 360,
"sellprice": 36,
"class": "item",
"quantity": 0,
"description": "A shimmering, iridescent scale that provides a calming aura of the tides.",
"id": "riverpearlscale"
}>>
<<set $serpentmarkscale to {
"name": "Serpent Mark Scale",
"strength": 0,
"agility": 3,
"willpower": 0,
"armor": 3,
"health": 0,
"energy": 0,
"evadescore": 5,
"price": 150,
"tripleprice": 450,
"sellprice": 45,
"class": "item",
"quantity": 0,
"description": "A dark scale engraved with natural markings; it feels strangely light and flexible.",
"id": "serpentmarkscale"
}>>
/* ─── BODY FORGING ITEMS (existing category additions) ─── */
<<set $beastsinewfiber to {
"name": "Beast Sinew Fiber",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 60, "tripleprice": 180, "sellprice": 18,
"class": "item", "quantity": 0,
"description": "Tough sinew from a spirit beast. Used in strength-forging recipes.",
"id": "beastsinewfiber"
}>>
<<set $ironcorehusk to {
"name": "Iron Core Husk",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 70, "tripleprice": 210, "sellprice": 21,
"class": "item", "quantity": 0,
"description": "Dense outer shell of an iron-type spirit fruit.",
"id": "ironcorehusk"
}>>
<<set $goldenmarrowfragment to {
"name": "Golden Marrow Fragment",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 200, "tripleprice": 600, "sellprice": 60,
"class": "item", "quantity": 0,
"description": "Rare marrow fragment suffused with golden qi. Fortifies bones at the foundation level.",
"id": "goldenmarrowfragment"
}>>
<<set $thunderlizardhide to {
"name": "Thunder Lizard Hide",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 130, "tripleprice": 390, "sellprice": 39,
"class": "item", "quantity": 0,
"description": "Hardened hide that conducts faint lightning. Used in defense-enhancing concoctions.",
"id": "thunderlizardhide"
}>>
<<set $solarstonepowder to {
"name": "Solar Stone Powder",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 110, "tripleprice": 330, "sellprice": 33,
"class": "item", "quantity": 0,
"description": "Ground from sun-hardened ore. Amplifies yang-aligned body techniques.",
"id": "solarstonepowder"
}>>
/* ─── AGILITY / MOVEMENT ITEMS ─── */
<<set $swiftwindfeather to {
"name": "Swiftwind Feather",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 55, "tripleprice": 165, "sellprice": 16,
"class": "item", "quantity": 0,
"description": "A feather from a wind-aspected spirit bird. Lightens the body.",
"id": "swiftwindfeather"
}>>
<<set $shadowstepmoss to {
"name": "Shadow Step Moss",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 65, "tripleprice": 195, "sellprice": 19,
"class": "item", "quantity": 0,
"description": "Grows only in lightless caves. Muffles footsteps and improves spatial awareness.",
"id": "shadowstepmoss"
}>>
<<set $cloudstepextract to {
"name": "Cloud Step Extract",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 90, "tripleprice": 270, "sellprice": 27,
"class": "item", "quantity": 0,
"description": "Distilled from high-altitude cloud moss. Reduces a cultivator's weight signature.",
"id": "cloudstepextract"
}>>
<<set $lightningsteptendon to {
"name": "Lightning Step Tendon",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 140, "tripleprice": 420, "sellprice": 42,
"class": "item", "quantity": 0,
"description": "From a beast struck by heavenly lightning. Transmits speed impulses instantly.",
"id": "lightningsteptendon"
}>>
<<set $voidstrideessence to {
"name": "Void Stride Essence",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 220, "tripleprice": 660, "sellprice": 66,
"class": "item", "quantity": 0,
"description": "Condenses spatial qi into liquid form. Grants brief flashes of displacement.",
"id": "voidstrideessence"
}>>
/* ─── MIND / WILLPOWER ITEMS ─── */
<<set $cinnabarheartstone to {
"name": "Cinnabar Heart Stone",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 75, "tripleprice": 225, "sellprice": 22,
"class": "item", "quantity": 0,
"description": "A red stone that vibrates in resonance with mental intent.",
"id": "cinnabarheartstone"
}>>
<<set $stillwaterpearlpowder to {
"name": "Stillwater Pearl Powder",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 85, "tripleprice": 255, "sellprice": 25,
"class": "item", "quantity": 0,
"description": "Ground from river pearls. Calms turbulent inner qi and strengthens resolve.",
"id": "stillwaterpearlpowder"
}>>
<<set $moonlitjadefragment to {
"name": "Moonlit Jade Fragment",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 145, "tripleprice": 435, "sellprice": 43,
"class": "item", "quantity": 0,
"description": "Jade soaked in moonlight for three full cycles. Purifies heart demons.",
"id": "moonlitjadeFragment"
}>>
<<set $emptymindherb to {
"name": "Empty Mind Herb",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 60, "tripleprice": 180, "sellprice": 18,
"class": "item", "quantity": 0,
"description": "A bitter herb that clears mental fog and improves focus during cultivation.",
"id": "emptymindherb"
}>>
<<set $soulmirrorcrystal to {
"name": "Soul Mirror Crystal",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 190, "tripleprice": 570, "sellprice": 57,
"class": "item", "quantity": 0,
"description": "A transparent crystal that reflects one's inner state. Used in advanced willpower refinement.",
"id": "soulmirrorcrystal"
}>>
/* ─── CHARISMA / SOCIAL ITEMS ─── */
<<set $rosedewhoney to {
"name": "Rose Dew Honey",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 50, "tripleprice": 150, "sellprice": 15,
"class": "item", "quantity": 0,
"description": "Honey from spirit bees. Sweetens the voice and softens the demeanor.",
"id": "rosedewhoney"
}>>
<<set $jadepetalpowder to {
"name": "Jade Petal Powder",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 70, "tripleprice": 210, "sellprice": 21,
"class": "item", "quantity": 0,
"description": "Ground from rare jade lotus petals. Improves complexion and social grace.",
"id": "jadepetalpowder"
}>>
<<set $phoenixcoilperfume to {
"name": "Phoenix Coil Perfume",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 160, "tripleprice": 480, "sellprice": 48,
"class": "item", "quantity": 0,
"description": "Distilled from phoenix tail feathers. Commands attention and inspires reverence.",
"id": "phoenixcoilperfume"
}>>
<<set $silvertongueroot to {
"name": "Silvertongue Root",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 80, "tripleprice": 240, "sellprice": 24,
"class": "item", "quantity": 0,
"description": "Chewed by diplomats before negotiations. Subtly aligns a speaker's words to the listener's desires.",
"id": "silvertongueroot"
}>>
/* ─── LUCK / INSIGHT ITEMS ─── */
<<set $fortunemistseed to {
"name": "Fortune Mist Seed",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 95, "tripleprice": 285, "sellprice": 28,
"class": "item", "quantity": 0,
"description": "Said to grow only where heaven's fortune pools.",
"id": "fortunemistseed"
}>>
<<set $prophetseyeflower to {
"name": "Prophet's Eye Flower",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 130, "tripleprice": 390, "sellprice": 39,
"class": "item", "quantity": 0,
"description": "A rare bloom that briefly heightens perception and insight.",
"id": "prophetseyeflower"
}>>
<<set $destinythreadfragment to {
"name": "Destiny Thread Fragment",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 250, "tripleprice": 750, "sellprice": 75,
"class": "item", "quantity": 0,
"description": "A fragment of someone's severed fate. Absorbing it slightly bends fortune in your favor.",
"id": "destinythreadfragment"
}>>
/* ─── HEALTH / VITALITY ITEMS ─── */
<<set $greenspiritsap to {
"name": "Green Spirit Sap",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 60, "tripleprice": 180, "sellprice": 18,
"class": "item", "quantity": 0,
"description": "Sap from a thousand-year wood spirit tree. Regenerates minor wounds.",
"id": "greenspiritsap"
}>>
<<set $bloodlotuspetal to {
"name": "Blood Lotus Petal",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 110, "tripleprice": 330, "sellprice": 33,
"class": "item", "quantity": 0,
"description": "Deep red petals that stimulate blood production and repair internal injuries.",
"id": "bloodlotuspetal"
}>>
<<set $heavenspringwater to {
"name": "Heaven Spring Water",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 200, "tripleprice": 600, "sellprice": 60,
"class": "item", "quantity": 0,
"description": "Water from a heavenly spring. Cleanses impurities and greatly strengthens the body's foundation.",
"id": "heavenspringwater"
}>>
<<set $undyingphoenixash to {
"name": "Undying Phoenix Ash",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 350, "tripleprice": 1050, "sellprice": 105,
"class": "item", "quantity": 0,
"description": "Ash from a phoenix rebirth. Said to repair even fatal wounds over time.",
"id": "undyingphoenixash"
}>>
/* ─── ENERGY / QI RECOVERY ITEMS ─── */
<<set $breathingmoonmoss to {
"name": "Breathing Moon Moss",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 55, "tripleprice": 165, "sellprice": 16,
"class": "item", "quantity": 0,
"description": "Absorbs lunar qi at night. Brewed into pills for energy restoration.",
"id": "breathingmoonmoss"
}>>
<<set $tidewaterpearl to {
"name": "Tidewater Pearl",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 120, "tripleprice": 360, "sellprice": 36,
"class": "item", "quantity": 0,
"description": "A spirit pearl formed at the ocean's deepest tides. Stores tremendous latent qi.",
"id": "tidewaterpearl"
}>>
<<set $primordialmistdrop to {
"name": "Primordial Mist Drop",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 300, "tripleprice": 900, "sellprice": 90,
"class": "item", "quantity": 0,
"description": "A single drop condensed from primordial chaos. Vastly expands the energy sea.",
"id": "primordialmistdrop"
}>>
/* ─── LIFESPAN ITEMS ─── */
<<set $agelesspinetwig to {
"name": "Ageless Pine Twig",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 180, "tripleprice": 540, "sellprice": 54,
"class": "item", "quantity": 0,
"description": "A twig from a ten-thousand-year pine. Slightly slows the aging process.",
"id": "agelesspinetwig"
}>>
<<set $eternalmoonresin to {
"name": "Eternal Moon Resin",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 280, "tripleprice": 840, "sellprice": 84,
"class": "item", "quantity": 0,
"description": "Resin secreted only during a full moon eclipse. Rumored to grant decades of extra life.",
"id": "eternalmoonresin"
}>>
<<set $heavenlongevityseed to {
"name": "Heaven Longevity Seed",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 500, "tripleprice": 1500, "sellprice": 150,
"class": "item", "quantity": 0,
"description": "A seed that blooms once every ten thousand years. The ultimate ingredient in lifespan-extending pills.",
"id": "heavenlongevityseed"
}>>
/* ─── DARK / DEMONIC ITEMS ─── */
<<set $demonbileextract to {
"name": "Demon Bile Extract",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 120, "tripleprice": 360, "sellprice": 36,
"class": "item", "quantity": 0,
"description": "Bile taken from a slain demon beast. Caustic to the righteous, nourishing to the wicked.",
"id": "demonbileextract"
}>>
<<set $heartdevilweed to {
"name": "Heart Devil Weed",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 90, "tripleprice": 270, "sellprice": 27,
"class": "item", "quantity": 0,
"description": "A violet weed that feeds on repressed desires. Brewed into corruption-inducing elixirs.",
"id": "heartdevilweed"
}>>
<<set $duskbloodmoss to {
"name": "Dusk Blood Moss",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 75, "tripleprice": 225, "sellprice": 22,
"class": "item", "quantity": 0,
"description": "Grows on cursed battlefields. Absorbs lingering resentment and killing intent.",
"id": "duskbloodmoss"
}>>
<<set $shadowlustpollen to {
"name": "Shadow Lust Pollen",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 150, "tripleprice": 450, "sellprice": 45,
"class": "item", "quantity": 0,
"description": "Pollen from a nocturnal spirit flower. Inflames hidden desires and weakens moral resistance.",
"id": "shadowlustpollen"
}>>
<<set $taboofleshseal to {
"name": "Taboo Flesh Seal",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 200, "tripleprice": 600, "sellprice": 60,
"class": "item", "quantity": 0,
"description": "A forbidden seal carved into demon flesh. Carrying it invites corruption.",
"id": "taboofleshseal"
}>>
<<set $abyssalheartcore to {
"name": "Abyssal Heart Core",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 400, "tripleprice": 1200, "sellprice": 120,
"class": "item", "quantity": 0,
"description": "The crystallized heart of an abyss demon. Radiates profound demonic will.",
"id": "abyssalheartcore"
}>>
<<set $voidcorruptiontear to {
"name": "Void Corruption Tear",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 550, "tripleprice": 1650, "sellprice": 165,
"class": "item", "quantity": 0,
"description": "A tear crystallized from a corrupted divine beast. The pinnacle of demonic ingredients.",
"id": "voidcorruptiontear"
}>>
<<set $demonicqidust to {
"name": "Demonic Qi Dust",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 60, "tripleprice": 180, "sellprice": 18,
"class": "item", "quantity": 0,
"description": "Fine dust suffused with demonic qi. A base material for dark concoctions.",
"id": "demonicqidust"
}>>
<<set $sinfleshpowder to {
"name": "Sin Flesh Powder",
"strength": 0, "agility": 0, "willpower": 0, "armor": 0,
"health": 0, "energy": 0, "evadescore": 0,
"price": 250, "tripleprice": 750, "sellprice": 75,
"class": "item", "quantity": 0,
"description": "Ground from the flesh of a cultivator who fell fully to the demonic path.",
"id": "sinfleshpowder"
}>><<if $corruption >= $equippedRobe.corruptionLock and $corruption >= $equippedUnderwear.corruptionLock>>
<<link "Go back" $passage>><</link>>
<<else>>
<i>I should probably put some clothes on ...</i>
<</if>>
<<nobr>>
<div class="tab-nav">
<<link "Items">><<goto "Inventory">><<set $pe to 0>><</link>><<link "Potions">><<goto "Inventory">><<set $pe to 1>><</link>><<link "Equipment">><<goto "Inventory">><<set $pe to 2>><</link>>
</div>
<<if $pe eq 0>>
<div class="spatial-ring-container">
<div class="inventory-header">
<h2>Your Spatial Ring</h2>
<p>Treasures and materials harvested from the myriad realms, stored within this ancient spatial artifact.</p>
</div>
<div class="wealth-display">
<div class="gold-icon">灵</div>
<div class="gold-amount"><<print $gold>> Spirit Stones</div>
<<set _totalItems to 0>>
<<for _item range $playeriteminventory>>
<<set _totalItems += _item.quantity>>
<</for>>
<br>Current carrying capacity: <<= _totalItems>> / <<print $playeriteminventorybaselimit>>
</div>
<<if $playeriteminventory.length gt 0>>
<table class="item-inventory-table">
<thead>
<tr>
<th style="width: 80px;"></th>
<th>Item</th>
<th style="width: 120px; text-align: center;">Quantity</th>
</tr>
</thead>
<tbody>
<<for _item range $playeriteminventory>>
<tr class="item-row">
<td style="text-align: center;">
<<if _item.quantity gt 0>><div class="item-icon">宝</div> <!-- Replace with actual <img> later -->
<</if>>
</td>
<td>
<<if _item.quantity gt 0>> <div class="item-name"><<print _item.name>></div><</if>>
<<if _item.description neq null>>
<<if _item.quantity gt 0>><div class="item-desc"><<print _item.description>></div><</if>>
<</if>>
</td>
<td style="text-align: center;">
<<if _item.quantity gt 0>><div class="quantity-glow"><<print _item.quantity>></div><</if>>
</td>
</tr>
<</for>>
</tbody>
</table>
<<else>>
<div class="empty-ring">
<p>Your spatial ring is empty.</p>
<p>Slay spirit beasts, gather heavenly herbs, and plunder ruins to fill it with immortal treasures.</p>
</div>
<</if>>
</div>
<<elseif $pe eq 1>>
<div class="elixir-pouch-container">
<div class="inventory-header">
<h2>Your Elixir Pouch</h2>
<p>Precious pills and spiritual elixirs gathered on your path to immortality.</p>
</div>
<div id="log"></div>
<<if $playerpotioninventory.length gt 0>>
<table class="elixir-inventory-table">
<thead>
<tr>
<th style="width: 80px;"></th>
<th>Elixir</th>
<th style="width: 100px; text-align: center;">Grade</th>
<th style="width: 100px; text-align: center;">Quantity</th>
<th style="width: 120px; text-align: center;">Action</th>
</tr>
</thead>
<tbody>
<<for _potion range $playerpotioninventory>>
<<set _rarityColor to
(_potion.grade <= 1 ? "#4fc3f7" :
_potion.grade <= 3 ? "#66bb6a" :
_potion.grade <= 5 ? "#ffa726" :
"#ab47bc") >> <!-- Blue → Green → Orange → Purple -->
<tr class="elixir-row">
<td style="text-align: center;">
<div class="elixir-icon">丹</div> <!-- Replace with <img src="your-icon-url.webp"> later -->
</td>
<td>
<div class="item-name" style="color: <<print _rarityColor>>;"><<print _potion.name>></div>
<<if _potion.description neq null>>
<div class="item-desc"><<print _potion.description>></div>
<</if>>
</td>
<td style="text-align: center; color: <<print _rarityColor>>; font-weight: bold;">
Grade <<print _potion.grade>>
</td>
<td style="text-align: center;">
<div class="quantity-glow"><<print _potion.quantity>></div>
</td>
<td style="text-align: center;">
<<capture _potion>>
<<link "Consume">>
<<set $selectedPotion to _potion>>
<<if _potion.quantity lte 0>>
<<set $playerpotioninventory.deleteAt($playerpotioninventory.indexOf(_potion))>>
<</if>>
<<replace "#use-log">>
<div class="use-log success">
<span class="glow-text">Spiritual qi surges!</span><br>
You consume the <<print _potion.name>>. A warm current flows through your meridians...
</div>
<</replace>>
<<useItem>> <!-- Apply your custom effect macro here -->
<</link>>
<</capture>>
</td>
</tr>
<</for>>
</tbody>
</table>
<<else>>
<div class="empty-pouch">
<p>Your elixir pouch is empty.</p>
<p>Seek out rare spirit-herbs and profound catalysts to sustain your journey toward immortality.</p>
</div>
<</if>>
<div id="use-log" class="log-area"></div>
</div>
<<elseif $pe eq 2>>
<div class="equipment-container">
<div class="equipment-header">
<h2>Heavenly Armory</h2>
<p>Equip spiritual artifacts and sacred garments to enhance your path to ascension.</p>
</div>
<div class="equipment-grid">
<!-- Robe Slot -->
<div class="equip-slot">
<div class="slot-title">🛡️ Outer Robes</div>
<<if $equippedRobe neq null>>
<div class="equipped-item">
<div class="item-name"><<print $equippedRobe.name>></div>
<div class="item-desc"><<print $equippedRobe.description>></div>
<div class="item-stats">
<<if $equippedRobe.stats neq null>>
<<set _keys to Object.keys($equippedRobe.stats)>>
<<for _i to 0; _i lt _keys.length; _i++>>
<<set _stat to _keys[_i]>>
<<set _val to $equippedRobe.stats[_stat]>>
+<<print _val>> <<print _stat.charAt(0).toUpperCase() + _stat.slice(1)>><br>
<</for>>
<<else>>
No stat bonuses
<</if>>
</div>
<<if $equippedRobe.durability neq null>>
<div>Durability: <<print $equippedRobe.durability>> / <<print $equippedRobe.maxDurability>></div>
<div class="durability-bar">
<div class="durability-fill" style="width: <<print ($equippedRobe.durability / $equippedRobe.maxDurability * 100)>>%;"></div>
</div>
<</if>>
<<if $equippedRobe.name neq "Naked State">><<link "Unequip" "Inventory">><<set $equippedRobe to $nakedState>><</link>><</if>>
</div>
<<else>>
<div class="empty-slot">No robe equipped</div>
<</if>>
<hr style="border:1px dashed #ffd700; margin:20px 0;">
<strong>Available:</strong><br>
<<if $robeInventory neq null && $robeInventory.length gt 0>>
<<for _item range $robeInventory>>
<<capture _item>>
<<if $equippedRobe neq null && $equippedRobe.name is _item.name>>
<span style="color:#888; font-style:italic;"><<print _item.name>> (equipped)</span><br>
<<else>>
<<link "<<print _item.name>>" "Inventory">>
<<set $equippedRobe to _item>>
<</link>><br>
<</if>>
<</capture>>
<</for>>
<<else>>
<i>No robes in inventory</i>
<</if>>
</div>
<!-- Underwear Slot -->
<div class="equip-slot">
<div class="slot-title">🌸 Intimate Layer</div>
<<if $equippedUnderwear neq null>>
<div class="equipped-item">
<div class="item-name"><<print $equippedUnderwear.name>></div>
<div class="item-desc"><<print $equippedUnderwear.description>></div>
<div class="item-stats">
<<if $equippedUnderwear.stats neq null>>
<<set _keys to Object.keys($equippedUnderwear.stats)>>
<<for _i to 0; _i lt _keys.length; _i++>>
<<set _stat to _keys[_i]>>
<<set _val to $equippedUnderwear.stats[_stat]>>
+<<print _val>> <<print _stat.charAt(0).toUpperCase() + _stat.slice(1)>><br>
<</for>>
<<else>>
No stat bonuses
<</if>>
</div>
<<if $equippedUnderwear.name neq "No Underwear">><<link "Unequip" "Inventory">><<set $equippedUnderwear to $noUnderwear>><</link>><</if>>
</div>
<<else>>
<div class="empty-slot">None worn</div>
<</if>>
<hr style="border:1px dashed #ffd700; margin:20px 0;">
<strong>Available:</strong><br>
<<if $underwearInventory neq null && $underwearInventory.length gt 0>>
<<for _item range $underwearInventory>>
<<capture _item>>
<<if $equippedUnderwear neq null && $equippedUnderwear.name is _item.name>>
<span style="color:#888; font-style:italic;"><<print _item.name>> (equipped)</span><br>
<<else>>
<<link "<<print _item.name>>" "Inventory">>
<<set $equippedUnderwear to _item>>
<</link>><br>
<</if>>
<</capture>>
<</for>>
<<else>>
<i>No intimate garments in inventory</i>
<</if>>
</div>
<!-- Weapon Slot -->
<div class="equip-slot">
<div class="slot-title">⚔️ Signature Weapon</div>
<<if $equippedWeapon neq null>>
<div class="equipped-item">
<div class="item-name"><<print $equippedWeapon.name>></div>
<div class="item-desc"><<print $equippedWeapon.description>></div>
<div class="item-stats">
<<if $equippedWeapon.stats neq null>>
<<set _keys to Object.keys($equippedWeapon.stats)>>
<<for _i to 0; _i lt _keys.length; _i++>>
<<set _stat to _keys[_i]>>
<<set _val to $equippedWeapon.stats[_stat]>>
+<<print _val>> <<print _stat.charAt(0).toUpperCase() + _stat.slice(1)>><br>
<</for>>
<<else>>
No stat bonuses
<</if>>
</div>
<<link "Unequip" "Inventory">><<set $equippedWeapon to null>><</link>>
</div>
<<else>>
<div class="empty-slot">Unarmed</div>
<</if>>
<hr style="border:1px dashed #ffd700; margin:20px 0;">
<strong>Available:</strong><br>
<<if $weaponInventory neq null && $weaponInventory.length gt 0>>
<<for _item range $weaponInventory>>
<<capture _item>>
<<if $equippedWeapon neq null && $equippedWeapon.name is _item.name>>
<span style="color:#888; font-style:italic;"><<print _item.name>> (equipped)</span><br>
<<else>>
<<link "<<print _item.name>>" "Inventory">>
<<set $equippedWeapon to _item>>
<</link>><br>
<</if>>
<</capture>>
<</for>>
<<else>>
<i>No weapons in inventory</i>
<</if>>
</div>
<!-- Accessories (3 slots) -->
<div class="equip-slot">
<div class="slot-title">💎 Accessories (3 slots)</div>
<<if $equippedAccessories neq null>>
<<for _i to 0; _i lt 3; _i++>>
<<set _acc to $equippedAccessories[_i]>>
<<capture _i, _acc>>
<<if _acc neq null>>
<div class="equipped-item" style="margin-bottom:15px;">
<div class="item-name">Slot <<print _i + 1>>: <<print _acc.name>></div>
<div class="item-desc"><<print _acc.description>></div>
<div class="item-stats">
<<if _acc.stats neq null>>
<<set _keys to Object.keys(_acc.stats)>>
<<for _j to 0; _j lt _keys.length; _j++>>
<<set _stat to _keys[_j]>>
<<set _val to _acc.stats[_stat]>>
+<<print _val>> <<print _stat.charAt(0).toUpperCase() + _stat.slice(1)>><br>
<</for>>
<<else>>
No stat bonuses
<</if>>
</div>
<<link "Unequip" "Inventory">><<set $equippedAccessories[_i] to null>><</link>>
</div>
<<else>>
<div class="empty-slot">Slot <<print _i + 1>>: Empty</div>
<</if>>
<</capture>>
<</for>>
<<else>>
<div class="empty-slot">No accessories equipped</div>
<</if>>
<hr style="border:1px dashed #ffd700; margin:20px 0;">
<strong>Available:</strong><br>
<<if $accessoryInventory neq null && $accessoryInventory.length gt 0>>
<<for _item range $accessoryInventory>>
<<capture _item>>
<<set _alreadyEquipped to false>>
<<set _equippedSlot to -1>>
<<if $equippedAccessories neq null>>
<<for _i to 0; _i lt 3; _i++>>
<<set _equippedAcc to $equippedAccessories[_i]>>
<<if _equippedAcc neq null && _equippedAcc.name is _item.name>>
<<set _alreadyEquipped to true>>
<<set _equippedSlot to _i>>
<<break>>
<</if>>
<</for>>
<</if>>
<<if _alreadyEquipped>>
<span style="color:#888; font-style:italic;"><<print _item.name>> (equipped in Slot <<print _equippedSlot + 1>>)</span><br>
<<else>>
<<set _freeSlot to -1>>
<<if $equippedAccessories neq null>>
<<for _i to 0; _i lt 3; _i++>>
<<if $equippedAccessories[_i] is null>>
<<set _freeSlot to _i>>
<<break>>
<</if>>
<</for>>
<</if>>
<<if _freeSlot gte 0>>
<<link "<<print _item.name>> → Slot <<print _freeSlot + 1>>" "Inventory">>
<<set $equippedAccessories[_freeSlot] to _item>>
<</link>><br>
<<else>>
<span style="color:#c66;">(All slots full)</span><br>
<</if>>
<</if>>
<</capture>>
<</for>>
<<else>>
<i>No accessories in inventory</i>
<</if>>
</div>
</div>
</div>
<</if>>
<</nobr>><<set $jadeprobe to {
id: "jadeprobe",
name: "Jade Meridian Probe",
description: "A thick, perfectly smooth jade dildo carved to stimulate deep internal meridians. Warms and pulses with channeled qi — designed for intense solo masturbation and yin essence refinement.",
price: 280,
sellprice: 70,
class: "toy",
lewd: true,
effect: "soloPenetration"
}>>
<<set $phoenixfeatherplug to {
id: "phoenixfeatherplug",
name: "Phoenix Feather Anal Plug",
description: "Tapered jade plug with soft phoenix feather tail. Inserted anally, it sends waves of warm yang fire through rear meridians - perfect for prolonged anal masturbation and forbidden pleasure cultivation.",
price: 320,
sellprice: 80,
class: "toy",
lewd: true,
effect: "analPlay"
}>>
<<set $lotusbeads to {
id: "lotusbeads",
name: "Lotus Prayer Beads",
description: "String of graduated rose quartz beads for progressive anal or vaginal insertion. Each bead vibrates with yin qi when pulled - ideal for extended masturbation sessions and meridian stretching.",
price: 350,
sellprice: 90,
class: "toy",
lewd: true,
effect: "beadInsertion"
}>>
<<set $merchantInventory to []>>
<<set $mysteriouspillforgeInventory to []>>
<<set $mysteriouspillforgePillRecipeInventory to []>>
<<set $mysteriouspillforgeInventory.push($strengthboostpotion1)>>
<<set $mysteriouspillforgePillRecipeInventory.push($strengthboostrecipe2, $agilityboostrecipe1, $agilityboostrecipe2, $willpowerboostrecipe1, $willpowerboostrecipe2, $charismaboostrecipe2, $luckboostrecipe1, $luckboostrecipe2, $insightboostrecipe1, $maxhealthrecipe1, $maxenergyrecipe1, $martialartsrecipe1, $armorboostrecipe1,
)>>
<<set $thunderclapswordforgeInventory to []>>
<<set $thunderclapswordforgeInventory.push($crimsonlotussword, $jadewhip, $phoenixfan
)>>
<<set $blissfurnacepavilionInventory to []>>
<<set $blissfurnacepavilionInventory.push($corruptionelixir, $succubusbreath, $forbiddenyangseed
)>>
<!-- Wandering merchants -->
<<set $wanderingMerchantInventory to []>>
<<set $wanderingMerchantInventory.push($copperskinpowder, $crimsonhideflake, $burningsandresin, $titanapehair, $spiritvinetendril)>>
/* ============================================================
PILL PAVILION — starter setup (place once at StoryInit, alongside other merchant inventories)
============================================================ */
/* ---- Master pool: all grade 1-2 pills available to be randomly stocked ---- */
<<set $pillpavilionMasterPool to []>>
<<set $pillpavilionMasterPool.push(
$strengthboostpotion1, $strengthboostpotion2,
$agilityboostpotion1, $agilityboostpotion2,
$willpowerboostpotion1, $willpowerboostpotion2,
$succubusbreath, $charismaboostpotion2,
$luckboostpotion1, $luckboostpotion2,
$insightboostpotion1, $insightboostpotion2,
$maxhealthpotion1, $maxhealthpotion2,
$maxenergypotion1, $maxenergypotion2,
$lifespanpotion1,
$spiritootpotion1, $spiritrootpotion2,
$martialartspotionpotion1, $martialartspotionpotion2,
$corruptionelixir1, $corruptionelixir,
$armorboostpotion1, $armorboostpotion2
)>>
/* ---- Current rotating stock: a random subset of the master pool, picked at restock ---- */
<<set $pillpavilionInventory to []>>
<<set $pillpavilionStock to {}>>
<<PillPavilionRestock>>
/* ---- Track the solar term at last restock, so we know when a new one rolls around ---- */
<<set $pillpavilionLastRestockTerm to $currentTerm>>
/* ---- Boutique-style chat lines for the pill vendor ---- */
<<set $pillPavilionChat to [
"Every pill on that shelf was refined under the correct lunar phase. Skip that step and you're just selling candy.",
"Grade 2? That's as far as I'll sell to a wandering disciple. The good stuff isn't for browsing eyes.",
"Burned three cauldrons getting this batch right. The Spirit Stones barely cover the charcoal.",
"You'd be amazed how many disciples take three of these at once thinking it triples the effect. It does not.",
"Patience is the real ingredient. Rush a pill and you get a very expensive stomach ache.",
"I don't ask why a cultivator wants what they want. I just make sure it works.",
"Some pills here came from herbs gathered near a beast corpse. Don't ask which ones.",
"When the stock runs dry, it runs dry. The cauldrons need their rest same as anyone.",
"A good pill master tastes the batch before selling it. A great one survives the tasting.",
"Half my regulars are sect elders pretending to be merchants. The other half are merchants pretending not to notice."
]>>
/* ==================== OUTER ROBES (Phoenix City — new) ==================== */
<<set $emberweaverobe to {
name: "Ember-Weave Robe",
description: "Threads spun with faint heat-qi keep the wearer warm even in mountain winds.",
stats: { willpower: 2, armor: 4 },
price: 240,
sellprice: 60,
class: "robe",
img: "emberweaverobe",
durability: 100,
maxDurability: 100,
corruptionLock: 0
}>>
<<set $vermillionsashrobe to {
name: "Vermillion Sash Robe",
description: "A fitted robe bound with a bright red sash, favored by Phoenix City merchants for its sharp silhouette.",
stats: { agility: 2, charisma: 2, armor: 3 },
price: 410,
sellprice: 100,
class: "robe",
img: "vermillionsashrobe",
durability: 95,
maxDurability: 95,
corruptionLock: 0
}>>
<<set $goldenphoenixrobe to {
name: "Golden Phoenix Robe",
description: "Embroidered with a rising phoenix in gold thread. A status symbol as much as protection.",
stats: { willpower: 3, charisma: 4, armor: 6 },
price: 850,
sellprice: 210,
class: "robe",
img: "goldenphoenixrobe",
durability: 120,
maxDurability: 120,
corruptionLock: 0
}>>
<<set $duskflameveilrobe to {
name: "Duskflame Veil Robe",
description: "Sheer outer layers in deep orange-red, cut to slip open easily. Popular among the bolder cultivators of the city.",
stats: { agility: 1, charisma: 5, armor: 2 },
price: 560,
sellprice: 140,
class: "robe",
img: "duskflameveilrobe",
lewd: true,
durability: 80,
maxDurability: 80,
corruptionLock: 20
}>>
/* ==================== UNDERWEAR (Phoenix City — new) ==================== */
<<set $sunsetsilkwraps to {
name: "Sunset Silk Wraps",
description: "Warm orange-gold wraps that hug close to the skin. Said to flatter the figure beneath any robe.",
stats: { charisma: 2 },
price: 180,
sellprice: 45,
class: "underwear",
img: "sunsetsilkwraps",
lewd: true,
corruptionLock: 0
}>>
<<set $phoenixemberteddy to {
name: "Phoenix Ember Teddy",
description: "Fine mesh dyed like dying embers. Heightens sensation along the skin.",
stats: { pleasureBonus: 8, charisma: 2 },
price: 390,
sellprice: 95,
class: "underwear",
img: "phoenixemberteddy",
lewd: true,
corruptionLock: 25
}>>
<<set $cranebonecorset to {
name: "Crane-Bone Corset",
description: "Light boning beneath silk gives a striking shape while channeling qi through the dantian.",
stats: { willpower: 2, agility: 1 },
price: 310,
sellprice: 75,
class: "underwear",
img: "cranebonecorset",
lewd: true,
corruptionLock: 0
}>>
/* ==================== ACCESSORIES (Phoenix City — new) ==================== */
<<set $phoenixplumeearrings to {
name: "Phoenix Plume Earrings",
description: "Tiny enchanted feathers that catch the light with every turn of the head.",
stats: { charisma: 3 },
price: 220,
sellprice: 55,
class: "accessory",
img: "phoenixplumeearrings"
}>>
<<set $emberlacquerbracelet to {
name: "Ember Lacquer Bracelet",
description: "Deep red lacquer over a thin metal band, faintly warm to the touch.",
stats: { strength: 1, willpower: 1, charisma: 1 },
price: 200,
sellprice: 50,
class: "accessory",
img: "emberlacquerbracelet"
}>>
<<set $silkenwaistribbon to {
name: "Silken Waist Ribbon",
description: "A long ribbon tied loosely at the hip, easily undone. Draws the eye.",
stats: { agility: 1, charisma: 3 },
price: 260,
sellprice: 65,
class: "accessory",
img: "silkenwaistribbon",
lewd: true
}>>
<<set $vermillionchoker to {
name: "Vermillion Choker",
description: "A thin band of red silk and gold thread worn snug at the throat.",
stats: { willpower: 2, charisma: 2 },
price: 280,
sellprice: 70,
class: "accessory",
img: "vermillionchoker",
lewd: true
}>>
<<set $phoenixfeatherfan to {
name: "Phoenix Feather Fan",
description: "A folding fan of dyed feathers, as much a fashion piece as a tool against the city heat.",
stats: { charisma: 4, insight: 1 },
price: 340,
sellprice: 85,
class: "accessory",
img: "phoenixfeatherfan"
}>>
/* ==================== PHOENIX SILK HOUSE — SHOP INVENTORY ==================== */
<<set $silkenpetalboutiqueInventory to []>>
<<set $silkenpetalboutiqueInventory.push(
$emberweaverobe, $vermillionsashrobe, $goldenphoenixrobe, $duskflameveilrobe,
$sunsetsilkwraps, $phoenixemberteddy, $cranebonecorset,
$phoenixplumeearrings, $emberlacquerbracelet, $silkenwaistribbon, $vermillionchoker, $phoenixfeatherfan
)>>/* NPC stat table */
<<widget "BookOfConnections_npcStats">>
<<if !$currentNPC.isDead>>
<div class="stat-table-container">
<table class="stat-table">
<tr>
<th>General</th>
<th>Combat</th>
</tr>
<tr>
<td>
<b>🧬 Lifespan:</b> <<print $currentNPC.NPClifespan>> / <<print $currentNPC.NPCmaxlifespan>><br>
<b>❤️ Health:</b> <<print $currentNPC.NPCcurrenthealth>> / <<print $currentNPC.NPCmaxhealth>><br>
<b>⚡ Energy:</b> <<print $currentNPC.NPCcurrentenergy>> / <<print $currentNPC.NPCmaxenergy>><br>
<b>🍀 Luck:</b> <<print $currentNPC.NPCluck>><br>
<b>🧠 Insight:</b> <<print $currentNPC.NPCinsight>><br>
<b>💪 Strength:</b> <<print $currentNPC.NPCbasestrength>><br>
<b>🌀 Willpower:</b> <<print $currentNPC.NPCbasewillpower>>
</td>
<td>
<b>🗡️ Attack:</b> <<print $currentNPC.NPCatk>><br>
<b>🛡️ Defense:</b> <<print $currentNPC.NPCdef>><br>
<b>💥 Crit Rate:</b> <<print $currentNPC.NPCcrit>>%<br>
<b>🛑 Crit Resist:</b> <<print $currentNPC.NPCcritres>>%<br>
<b>👟 Agility:</b> <<print $currentNPC.NPCagility>><br>
<b>🥋 Martial Arts:</b> <<print $currentNPC.NPCmartialArts>><br>
<b>🌌 Spiritual Root:</b> <<print $currentNPC.NPCspiritualRoot>>
</td>
</tr>
</table>
</div>
<<else>>
<</if>>
<</widget>>
/* NPC family tree */
<<widget "DrawConnectionMap">>
<<set _focus to $args[0]>>
<<set _rel to _focus.relations || {}>>
<div class="scroll-tree">
<div class="tree-row">
<<if (_rel.masters || []).length gt 0>>
<div class="relation-group">
<div class="relation-label">Master<<if _rel.masters.length gt 1>>s<</if>></div>
<div class="card-container">
<<for _id range _rel.masters>>
<<if _id eq "player">>
<<set _r to { id:"player", fullname:"You", gender:$playerGender, isPlayer:true }>>
<<else>>
<<set _r to $known_npc_list.find(n => n.id === _id)>>
<<if not _r and $encounterBatch>>
<<set _r to $encounterBatch[_id]>>
<</if>>
<</if>>
<<if _r>><<MiniCard _r>><</if>>
<</for>>
</div>
</div>
<</if>>
<<if (_rel.parents || []).length gt 0>>
<<for _id range _rel.parents>>
<<if _id eq "player">>
<<set _r to { id:"player", fullname:"You", gender:$playerGender, isPlayer:true }>>
<<else>>
<<set _r to $known_npc_list.find(n => n.id === _id)>>
<<if not _r and $encounterBatch>>
<<set _r to $encounterBatch[_id]>>
<</if>>
<</if>>
<<if _r>>
<div class="relation-group">
<div class="relation-label"><<print (_r.gender === "male" ? "Father" : "Mother")>></div>
<div class="card-container"><<MiniCard _r>></div>
</div>
<</if>>
<</for>>
<</if>>
</div>
<div class="tree-row">
<<if (_rel.spouses || []).length gt 0>>
<div class="relation-group">
<div class="relation-label">Spouse<<if _rel.spouses.length gt 1>>s<</if>></div>
<div class="card-container">
<<for _id range _rel.spouses>>
<<if _id eq "player">>
<<set _r to { id:"player", fullname:"You", gender:$playerGender, isPlayer:true }>>
<<else>>
<<set _r to $known_npc_list.find(n => n.id === _id)>>
<<if not _r and $encounterBatch>>
<<set _r to $encounterBatch[_id]>>
<</if>>
<</if>>
<<if _r>> <<MiniCard _r>> <</if>>
<</for>>
</div>
</div>
<</if>>
<<if (_rel.lovers || []).length gt 0>>
<div class="relation-group">
<div class="relation-label">Lover<<if _rel.lovers.length gt 1>>s<</if>></div>
<div class="card-container">
<<for _id range _rel.lovers>>
<<if _id eq "player">>
<<set _r to { id:"player", fullname:"You", gender:$playerGender, isPlayer:true }>>
<<else>>
<<set _r to $known_npc_list.find(n => n.id === _id)>>
<<if not _r and $encounterBatch>>
<<set _r to $encounterBatch[_id]>>
<</if>>
<</if>>
<<if _r>> <<MiniCard _r>> <</if>>
<</for>>
</div>
</div>
<</if>>
<div class="npc-mini-card focus">
<div style="font-weight:bold; color:#b22222;">
<<if _focus.isDead>>✟ <</if>><<= _focus.fullname>>
</div>
<div style="font-size:0.75em; color:#666;">(Focus)</div>
</div>
<<if (_rel.siblings || []).length gt 0>>
<div class="relation-group">
<div class="relation-label">Sibling<<if _rel.siblings.length gt 1>>s<</if>></div>
<div class="card-container">
<<for _id range _rel.siblings>>
<<if _id eq "player">>
<<set _r to { id:"player", fullname:"You", gender:$playerGender, isPlayer:true }>>
<<else>>
<<set _r to $known_npc_list.find(n => n.id === _id)>>
<<if not _r and $encounterBatch>>
<<set _r to $encounterBatch[_id]>>
<</if>>
<</if>>
<<if _r>> <<MiniCard _r>> <</if>>
<</for>>
</div>
</div>
<</if>>
</div>
<div class="tree-row">
<<if (_rel.children || []).length gt 0>>
<<for _id range _rel.children>>
<<if _id eq "player">>
<<set _r to { id:"player", fullname:"You", gender:$playerGender, isPlayer:true }>>
<<else>>
<<set _r to $known_npc_list.find(n => n.id === _id)>>
<<if not _r and $encounterBatch>>
<<set _r to $encounterBatch[_id]>>
<</if>>
<</if>>
<<if _r>>
<div class="relation-group">
<div class="relation-label"><<print (_r.gender === "male" ? "Son" : "Daughter")>></div>
<div class="card-container"><<MiniCard _r>></div>
</div>
<</if>>
<</for>>
<</if>>
<<if (_rel.apprentices || []).length gt 0>>
<div class="relation-group">
<div class="relation-label">Apprentice<<if _rel.apprentices.length gt 1>>s<</if>></div>
<div class="card-container">
<<for _id range _rel.apprentices>>
<<if _id eq "player">>
<<set _r to { id:"player", fullname:"You", gender:$playerGender, isPlayer:true }>>
<<else>>
<<set _r to $known_npc_list.find(n => n.id === _id)>>
<<if not _r and $encounterBatch>>
<<set _r to $encounterBatch[_id]>>
<</if>>
<</if>>
<<if _r>> <<MiniCard _r>> <</if>>
<</for>>
</div>
</div>
<</if>>
</div>
<<if (_rel.parents || []).length == 0 and (_rel.siblings || []).length == 0 and (_rel.masters || []).length == 0 and (_rel.apprentices || []).length == 0 and (_rel.children || []).length == 0 and (_rel.spouses || []).length == 0 and (_rel.lovers || []).length == 0>>
<div style="text-align:center; padding:40px; color:#819ca9; font-style:italic;">
No known connections... The threads of fate around this one remain hidden.
</div>
<</if>>
</div>
<</widget>>
/* NPC mini card for lists and connections */
<<widget "MiniCard">>
<<set _npc to $args[0]>>
<div @class="'npc-mini-card' + (_npc.isDead ? ' dead-npc' : '')">
<<if _npc.isPlayer>>
<div style="text-align:center;">
<span class="treegrid link-red">
<b><<link "You" "Status">><</link>></b>
</span>
</div>
<<else>>
<span class="treegrid">@@.link-brown;
<<capture _npc>>
<<link _npc.fullname "RelationsDetailed">>
<<set $selectedNPCid to _npc.id>>
<img @src="'images/' + _npc.enemyregion + '/' + _npc.enemyimage + '.jpg'">
<</link>>
<</capture>>
@@</span>
<</if>>
</div>
<</widget>>
/* Batch NPC encounter widget */
<<widget "GenerateEncounterBatch">>
<<set _locationType to $args[0]>>
<<set _specificSect to $args[1] || null>>
<<set $encounterBatch to {}>>
<<set _possibleRelatives to []>>
<<set _familiarCount to 0>>
<<set _unknownCount to 0>>
<!-- Determine batch size based on location -->
<<set _batchSize to 0>>
<<switch _locationType>>
<<case "tavern">> <<set _batchSize to random(5, 8)>>
<<case "sect">> <<set _batchSize to random(6, 10)>>
<<case "mortal">> <<set _batchSize to random(4, 7)>>
<<case "wilderness">> <<set _batchSize to random(2, 4)>>
<<default>> <<set _batchSize to random(3, 6)>>
<</switch>>
<!-- FAMILIAR FACES (20-40% of batch) -->
<<set _familiarPercentage to 20>>
<<set _targetFamiliarCount to Math.floor(_batchSize * _familiarPercentage / 100)>>
<<set _targetFamiliarCount to Math.max(1, Math.min(3, _targetFamiliarCount))>>
<!-- Gather possible familiars (relatives + known but unmet NPCs) -->
<<set _possibleFamiliars to []>>
<!-- Add relatives of known NPCs -->
<<set _knownMetList to $known_npc_list.filter(function(n) { return n.isMet and !n.isDead; })>>
<<for _known range _knownMetList>>
<<if _known.relations>>
<<set _relTypes to ["masters", "parents", "spouses", "siblings", "apprentices", "children"]>>
<<for _type range _relTypes>>
<<if _known.relations[_type] and _known.relations[_type].length gt 0>>
<<for _relId range _known.relations[_type]>>
<<set _rel to ($encounterBatch[_relId] || $known_npc_list.find(function(n) { return n.id === _relId; }))>>
<<if _rel and !_rel.isMet and !_rel.isDead>>
<<set _possibleFamiliars.push(_rel)>>
<</if>>
<</for>>
<</if>>
<</for>>
<</if>>
<</for>>
<!-- Also add any unmet NPCs from known_npc_list -->
<<set _unmetList to $known_npc_list.filter(function(n) { return !n.isMet and !n.isDead; })>>
<<for _unmet range _unmetList>>
<<set _found to false>>
<<for _fam range _possibleFamiliars>>
<<if _fam.id is _unmet.id>>
<<set _found to true>>
<</if>>
<</for>>
<<if not _found>>
<<set _possibleFamiliars.push(_unmet)>>
<</if>>
<</for>>
<!-- Select familiars if available -->
<<if _possibleFamiliars.length gt 0>>
<<set _familiarCount to Math.min(_targetFamiliarCount, _possibleFamiliars.length)>>
<<for _i = 0; _i lt _familiarCount; _i++>>
<<set _chosen to _possibleFamiliars.random()>>
<<set _chosen.isFamiliar to true>>
<!-- Check if this is a relative -->
<<set _isRel to false>>
<<for _known range _knownMetList>>
<<if _known.relations>>
<<set _relTypes to ["masters", "parents", "spouses", "siblings", "apprentices", "children"]>>
<<for _type range _relTypes>>
<<if _known.relations[_type] and _known.relations[_type].includes(_chosen.id)>>
<<set _isRel to true>>
<</if>>
<</for>>
<</if>>
<</for>>
<<set _chosen.isRelative to _isRel>>
<<set $encounterBatch[_chosen.id] to _chosen>>
<!-- Remove from pool to avoid duplicates -->
<<set _newFamiliars to []>>
<<for _fam range _possibleFamiliars>>
<<if _fam.id != _chosen.id>>
<<set _newFamiliars.push(_fam)>>
<</if>>
<</for>>
<<set _possibleFamiliars to _newFamiliars>>
<</for>>
<</if>>
<!-- Fill remaining with UNKNOWN NPCs -->
<<set _unknownCount to _batchSize - _familiarCount>>
<<for _i = 0; _i lt _unknownCount; _i++>>
<!-- Determine realm and stage based on location -->
<<set _realmName = "">>
<<set _stageName = "">>
<<switch _locationType>>
<<case "mortal">>
<<set _realmName = "Mortal">>
<<set _stageName = "">>
<<case "sect">>
<<set _realmOptions to ["Body Tempering Realm", "Meridian Awakening Realm", "Qi Condensation Realm"]>>
<<set _stageOptions to ["Early","Middle","Late"]>>
<<set _realmName to _realmOptions.random()>>
<<set _stageName to _stageOptions.random()>>
<<case "wilderness">>
<<set _realmOptions to ["Body Tempering Realm", "Meridian Awakening Realm"]>>
<<set _stageOptions to ["Early","Middle","Late"]>>
<<set _realmName to _realmOptions.random()>>
<<set _stageName to _stageOptions.random()>>
<<default>> <!-- tavern -->
<<set _realmOptions to ["Body Tempering Realm", "Meridian Awakening Realm", "Qi Condensation Realm"]>>
<<set _stageOptions to ["Early","Middle","Late"]>>
<<set _realmName to _realmOptions.random()>>
<<set _stageName to _stageOptions.random()>>
<</switch>>
<!-- Compute power using the correct variables -->
<<set _power = $power[_realmName][_stageName]>>
<!-- Generate NPC based on realm -->
<<set _gender to ["male","female"].random()>>
<<set _name to "">>
<<if _gender eq "male">>
<<set _name to $male_npc_names.random()>>
<<else>>
<<set _name to $female_npc_names.random()>>
<</if>>
<<set _surname to $npc_surnames.random()>>
<<set _fullname to _surname + " " + _name>>
<<set _intTrait = $NPCinternalOptions.random()>>
<<set _extTrait = $NPCexternalOptions.random()>>
<<if _realmName neq "Mortal">>
/* Cultivator — use CreateNPC001 */
<<CreateNPC001>>
<<if _locationType eq "sect">>
<<set _npc.sectNPC to (_specificSect || "Unaffiliated")>>
<<set _npc.NPCrank to (_specificSect ? ["Disciple","Inner Disciple","Elder"].random() : "Cultivator")>>
<<set _npc.NPClocation to (_specificSect || $region)>>
<</if>>
<<else>>
<!-- Mortal NPC -->
<<set _npc to {
id: random(0, 10000) + Date.now() + _i,
name: _name,
power: _power,
surname: _surname,
fullname: _fullname,
gender: _gender,
realm: "Mortal",
NPCrank: "Commoner",
sectNPC: "Unaffiliated",
NPClocation: $region + " Village",
enemyregion: "Enemy",
enemyimage: ["enemy1", "enemy2", "enemy3", "enemy4"].random(),
NPCmaxlifespan: random(60, 80),
NPClifespan: random(18, 60),
NPCmaxhealth: random(80, 120),
NPCcurrenthealth: random(80, 120),
NPCmaxenergy: random(40, 60),
NPCcurrentenergy: random(40, 60),
NPCluck: random(1, 3),
NPCinsight: random(1, 3),
NPCbasestrength: random(1, 3),
NPCbasewillpower: random(1, 3),
NPCatk: random(5, 10),
NPCdef: random(1, 3),
NPCcrit: 0,
NPCcritres: 0,
NPCagility: random(2, 4),
NPCmartialArts: 0,
NPCspiritualRoot: 0,
RightTendencies: random(100,200),
DemonTendencies: random(100,200),
depravity: random(1, 10),
friendship: 0,
charm: 5,
talk: 0,
hadSex: 0,
deathCause: null, /* "old_age", "murder", "revenge_killed", etc.*/
killedByPlayer: false,
killedInRevenge: false, /* true if killed during a revenge encounter*/
deathGrudgeType: null, /* the type of grudge they were avenging*/
deathGrudgeVictim: null, /* the victim they were avenging*/
isMet: false,
isDead: false,
isFamiliar: false,
isRelative: false,
isUnknown: true,
hasGrudge: false,
relations: { parents: [], masters: [], spouses: [], siblings: [], children: [], apprentices: [] }
}>>
<</if>>
<<set $encounterBatch[_npc.id] to _npc>>
<</for>>
<!-- Store metadata -->
<<set $encounterMetadata to {
locationType: _locationType,
specificSect: _specificSect,
familiarCount: _familiarCount,
unknownCount: _unknownCount,
totalSize: _batchSize
}>>
<</widget>>
<<widget "DisplayEncounter">>
<<RelocationNpcPosition>>
<<set _batch to $encounterBatch>>
<<set _meta to $encounterMetadata || {}>>
<<set $PlayerLocation to $region>> /* Use your actual player location variable */
<<set _currentpassage to passage()>>
<!-- Count relatives for display -->
<<set _relativeCount to 0>>
<<for _id, _npc range _batch>>
<<if _npc.isRelative>>
<<set _relativeCount to _relativeCount + 1>>
<</if>>
<</for>>
<!-- Find known NPCs at this location -->
<<set _knownAtLocation to []>>
<<for _i = 0; _i lt $known_npc_list.length; _i++>>
<<set _knownNPC to $known_npc_list[_i]>>
<<if _knownNPC.NPClocation eq $PlayerLocation and !_knownNPC.isDead>>
<<set _knownAtLocation.push(_knownNPC)>>
<</if>>
<</for>>
<!-- Dynamic title -->
<<switch _meta.locationType>>
<<case "tavern">>
<h3>✦ Tavern ✦</h3>
<p class="location-desc">The smell of wine and spirit beasts fills the air...</p>
<<case "sect">>
<h3>✦ <<print _meta.specificSect || "The Sect">> Grounds ✦</h3>
<p class="location-desc">Disciples practice forms as elders pass by...</p>
<<case "mortal">>
<h3>✦ Mortal Village Market ✦</h3>
<p class="location-desc">Ordinary folk go about their day, unaware of cultivation...</p>
<<case "wilderness">>
<h3>✦ Wild Mountains ✦</h3>
<p class="location-desc">Dangerous aura permeates the air...</p>
<</switch>>
<!-- Stats bar - compact -->
<div class="encounter-stats-bar">
<span class="stat-pill">Total: <<print _meta.totalSize + _knownAtLocation.length>></span>
<<if _meta.familiarCount gt 0>>
<span class="stat-pill familiar">Familiar: <<print _meta.familiarCount>></span>
<</if>>
<<if _meta.unknownCount gt 0>>
<span class="stat-pill unknown">Unknown: <<print _meta.unknownCount>></span>
<</if>>
<<if _knownAtLocation.length gt 0>>
<span class="stat-pill known">Known: <<print _knownAtLocation.length>></span>
<</if>>
<<if _relativeCount gt 0>>
<span class="stat-pill bloodline">Bloodline: <<print _relativeCount>></span>
<</if>>
</div>
<div class="encounter-grid">
<!-- First display known NPCs at this location -->
<<for _known range _knownAtLocation>>
<<capture _known>>
<div class="encounter-card known-card">
<!-- Top row: Name/rank and indicator -->
<div class="card-header">
<span class="card-title">
<<print _known.fullname>>
</span>
<<if _known.relations and ( _known.relations.parents.length gt 0 or _known.relations.siblings.length gt 0 or _known.relations.spouses.length gt 0 )>>
<span class="card-badge bloodline" title="Has family connections">⚡</span>
<</if>>
</div>
<!-- Middle: Realm -->
<div class="card-realm">
<<if _known.realm>>
<<print _known.realm>>
<<else>>
Commoner
<</if>>
</div>
<!-- Bottom: Sect (if any) -->
<<if _known.sectNPC and _known.sectNPC neq "Unaffiliated">>
<div class="card-sect" title="<<print _known.sectNPC>>">
<<print _known.sectNPC.split(" ").slice(0,2).join(" ")>>
</div>
<</if>>
<!-- Approach link -->
<div class="card-action">
<<link "Approach">>
<<set $currentEncounterNPC to _known>>
<<set $encounterOrigin to _meta.locationType>>
<<goto "EncounterInteraction">>
<</link>>
</div>
</div>
<</capture>>
<</for>>
<!-- Then display unknown/batch NPCs -->
<<for _id, _npc range _batch>>
<<capture _npc>>
<div class="encounter-card">
<!-- Top row: Name/rank and indicator -->
<div class="card-header">
<span class="card-title">
<<if _npc.isUnknown>>
???
<<else>>
<<if _npc.realm eq "Mortal">>
Mortal
<<else>>
<<print _npc.NPCrank || "Cultivator">>
<</if>>
<</if>>
</span>
<<if _npc.isFamiliar and !_npc.isUnknown>>
<span class="card-badge <<if _npc.isRelative>>bloodline<<else>>familiar<</if>>">
<<if _npc.isRelative>>⚡<<else>>✦<</if>>
</span>
<</if>>
</div>
<!-- Middle: Realm (compact) -->
<div class="card-realm">
<<if !_npc.isUnknown and _npc.realm and _npc.realm neq "Mortal">>
<<print _npc.realm>>
<<elseif !_npc.isUnknown and _npc.realm eq "Mortal">>
Commoner
<<else>>
<span class="unknown-text">???</span>
<</if>>
</div>
<!-- Bottom: Sect (if any) -->
<<if !_npc.isUnknown and _npc.sectNPC and _npc.sectNPC neq "Unaffiliated">>
<div class="card-sect" title="<<print _npc.sectNPC>>">
<<print _npc.sectNPC.split(" ").slice(0,2).join(" ")>>
</div>
<</if>>
<!-- Approach link -->
<div class="card-action">
<<link "Approach">>
<<set $currentEncounterNPC to _npc>>
<<set $encounterOriginPassage to passage()>>
<<goto "EncounterInteraction">>
<</link>>
</div>
</div>
<</capture>>
<</for>>
</div>
<!-- Refresh option -->
<div class="encounter-actions">
<<if $energy gte 10>>
<<link "⟳ Wait" _currentpassage>>
<<GenerateEncounterBatch _meta.locationType _meta.specificSect>>
<<DisplayEncounter>>
<</link>>
<</if>>
</div>
<</widget>><<widget "RelationshipType">>
<<if _npc neq null>>
<<if _npc.relationshipType is "enemy">>
Enemy
<<elseif _npc.relationshipType is "lover" and _npc.hadSex neq null and _npc.hadSex eq 1>>
Lover
<<elseif _npc.mentorshipType neq null and _npc.mentorshipType eq 1>>
Master
<<elseif _npc.mentorshipType neq null and _npc.mentorshipType eq 2>>
Apprentice
<<elseif _npc.friendship neq null and _npc.talk neq null and _npc.friendship gte 30 and _npc.friendship lt 70>>
Friend
<<elseif _npc.friendship neq null and _npc.talk neq null and _npc.friendship lt 20 and _npc.talk lt 3>>
Stranger
<<else>>
Acquaintance
<</if>>
<<else>>
Stranger
<</if>>
<</widget>>
<<widget "NPCMeter">>
<<set _percent = Math.clamp(($args[0] / $args[1]) * 100, 0, 100)>>
<div class="meter-container">
<div class="meter-label">_args[2]: $args[0] / $args[1]</div>
<div class="meter-bg">
<div class="meter-fill" @style="'width: ' + _percent + '%; background-color: ' + $args[3] + ';'"></div>
</div>
</div>
<</widget>>
<<widget "NpcPosition">>
<<if $turns % 12 == 0>>
<<for _ab range $known_npc_list>>
<<set _ab.NPClocation = ["Jade Creek Town", "Northern Phoenix City", "Blood Sand Reach", "Hundred Sorrows Mountain", "Ghost King Netherworld Sect", "Clear Sky Azure Dragon Pavilion"].random()>>
<</for>>
<</if>>
<</widget>>
<<widget "RelocationNpcPosition">>
<<set _roll to random(1, 100)>>
<<if _roll lte 30>>
<<for _ab range $known_npc_list>>
<<set _ab.NPClocation = ["Jade Creek Town", "Northern Phoenix City", "Blood Sand Reach", "Hundred Sorrows Mountain", "Ghost King Netherworld Sect", "Clear Sky Azure Dragon Pavilion"].random()>>
<</for>>
<</if>>
<</widget>>
<<widget "BattleAddNPC">>\
<<run $known_npc_list.push($currentEnemy)>>\
<</widget>>\
<<widget "AddNPC">>\
<<run $known_npc_list.push(_npc)>>\
<</widget>>\
<<widget "RemoveNPC">>
<<capture _npc>>
<<for _i to 0; _i < $known_npc_list.length; _i++>>
<<if $known_npc_list[_i].id is _npc.id>>
<<run $known_npc_list.deleteAt(_i)>>
<<break>>
<</if>>
<</for>>
/* Optional: Reset page if list becomes empty or current page is invalid */
<<if $known_npc_list.length is 0 or $relationPage > Math.ceil($known_npc_list.length / 3)>>
<<set $relationPage to 1>>
<</if>>
<</capture>>
<</widget>>
<<widget "AddNPCWithFamily">>
<<silently>>
<<set _mainNPC to $args[0]>>
/* 1. Automatically mark the main NPC as met and known */
<<set _mainNPC.isMet to true>>
<<set _mainNPC.isUnknown to false>>
/* 2. Safety Check: Only push if they aren't already in the list */
<<if !$known_npc_list.some(function(n) { return n.id === _mainNPC.id; })>>
<<run $known_npc_list.push(_mainNPC)>>
<<else>>
/* If they somehow already exist, update their data instead of duplicating */
<<set _idx to $known_npc_list.findIndex(function(n) { return n.id === _mainNPC.id; })>>
<<run Object.assign($known_npc_list[_idx], _mainNPC)>>
<</if>>
/* Store current batch */
<<set _tempBatch to $encounterBatch>>
/* Generate family - this creates a fresh $encounterBatch */
<<GenerateLineageBatch _mainNPC>>
/* 3. Add all family members (keeping them unknown until the player actually meets them) */
<<for _id, _family range $encounterBatch>>
<<if _family.id != _mainNPC.id>>
<<set _family.isMet to false>>
<<set _family.isUnknown to true>>
/* Safety Check for family members too */
<<if !$known_npc_list.some(function(n) { return n.id === _family.id; })>>
<<run $known_npc_list.push(_family)>>
<</if>>
<</if>>
<</for>>
/* Restore original encounter batch */
<<set $encounterBatch to _tempBatch>>
<</silently>>
<</widget>>
<!-- Display NPC's -->
<<widget "DisplayNPCS">>
/* Accept arguments - $args[0] will be the first argument after widget name */
<<set _locationType to $args[0] || "wilderness">> /* Default to "sect" if not provided */
<<set _specificSect to $args[1] || null>> /* Optional second argument */
<<if $peopleVisible is undefined>>
<<set $peopleVisible = false>>
<</if>>
<div id="people-ui">
<<if $peopleVisible>>
<<link "Avert your gaze">>
<<set $peopleVisible = false>>
<<run Engine.play(passage())>>
<</link>>
<div style="margin-top:10px;">
<<DisplayEncounter>>
</div>
<<else>>
<<link "Look around people">>
<<set $peopleVisible = true>>
/* Pass the arguments to GenerateEncounterBatch */
<<GenerateEncounterBatch _locationType _specificSect>>
<<run Engine.play(passage())>>
<</link>>
<</if>>
</div>
<</widget>>
<<widget "UpdateNPCStatsForRealm">>
<<silently>>
<<set _npc = $args[0]>>
<<set _debug = []>> /* For debugging */
/* Safety checks */
<<if not _npc>>
<<set _debug.push("No NPC provided")>>
<<elseif not _npc.realm>>
<<set _debug.push("NPC has no realm property")>>
<</if>>
<<if _debug.length == 0>>
<<set _realmName = _npc.realm.split(" ").slice(0,-1).join(" ")>>
<<set _stageName = _npc.realm.split(" ").pop()>>
<<set _debug.push("Realm: " + _realmName + ", Stage: " + _stageName)>>
/* Check if stats object exists */
<<if not window.GenerationNPCRealmStats and not $GenerationNPCRealmStats>>
<<set _debug.push("ERROR: $GenerationNPCRealmStats is not defined")>>
<<else>>
<<set _statsObj = $GenerationNPCRealmStats || window.GenerationNPCRealmStats>>
<<if not _statsObj[_realmName]>>
<<set _debug.push("ERROR: No stats for realm: " + _realmName)>>
<<elseif not _statsObj[_realmName][_stageName]>>
<<set _debug.push("ERROR: No stats for stage: " + _stageName + " in realm " + _realmName)>>
<<else>>
<<set _stats = _statsObj[_realmName][_stageName]>>
<<set _debug.push("Stats found, updating...")>>
/* Update stats */
<<set _npc.NPCmaxhealth = random(_stats.health[0], _stats.health[1])>>
<<set _npc.NPCcurrenthealth = _npc.NPCmaxhealth>>
<<set _npc.NPCmaxenergy = random(_stats.energy[0], _stats.energy[1])>>
<<set _npc.NPCcurrentenergy = _npc.NPCmaxenergy>>
<<set _npc.NPCluck = random(_stats.luck[0], _stats.luck[1])>>
<<set _npc.NPCinsight = random(_stats.insight[0], _stats.insight[1])>>
<<set _npc.NPCbasestrength = random(_stats.basestrength[0], _stats.basestrength[1])>>
<<set _npc.NPCbasewillpower = random(_stats.basewillpower[0], _stats.basewillpower[1])>>
<<set _npc.NPCatk = random(_stats.atk[0], _stats.atk[1])>>
<<set _npc.NPCdef = random(_stats.def[0], _stats.def[1])>>
<<set _npc.NPCcrit = random(_stats.crit[0], _stats.crit[1])>>
<<set _npc.NPCcritres = random(_stats.critres[0], _stats.critres[1])>>
<<set _npc.NPCagility = random(_stats.agility[0], _stats.agility[1])>>
<<set _npc.NPCmartialArts = random(_stats.martialArts[0], _stats.martialArts[1])>>
<<set _npc.NPCspiritualRoot = random(_stats.spiritualRoot[0], _stats.spiritualRoot[1])>>
<<set _npc.NPCmaxlifespan = random(_stats.lifespan[0], _stats.lifespan[1])>>
<<set _debug.push("Update complete")>>
<</if>>
<</if>>
<</if>>
/* Store debug info for display */
<<set $lastStatsDebug = _debug>>
<</silently>>
/* Optionally display debug output */
<<if $debugMode>>
<div style="border:1px solid blue; padding:5px; margin:5px; font-size:small;">
<b>Stats Update Debug:</b><br>
<<for _msg range $lastStatsDebug>>
<<print _msg>><br>
<</for>>
</div>
<</if>>
<</widget>>
<<widget "NPCRumours">>
<<if $known_npc_list.length gt 0>>
<<if random(1,100) lte 20>>
<<set _npc to $known_npc_list.random()>>
<<set _rumourType to random(1,100)>>
<<set _text to "">>
<<if _npc.isDead>>
<<set _rumourType to 95>> /* Redirect to death memory */
<</if>>
<<switch _rumourType>>
<<case 1 to 6>> /* Breakthrough! (6%) */
<<set _stages to ["early", "middle", "late"]>>
<<set _currentStage to _npc.realm.split(" ").pop()>>
<<set _idx to _stages.indexOf(_currentStage)>>
<<if _idx lt 2>>
<<set _newStage to _stages[_idx + 1]>>
<<set _npc.realm to _npc.realm.split(" ").slice(0,-1).join(" ") + " " + _newStage>>
<<UpdateNPCStatsForRealm _npc>>
<<set _text to `Whispers spread like wildfire: ${_npc.fullname} has achieved a breakthrough to ${_newStage}-stage ${_npc.realm.split(" ").slice(0,-1).join(" ")}!`>>
<<else>>
<<set _realms to ["Body Tempering Realm", "Meridian Awakening Realm", "Qi Condensation Realm"]>>
<<set _curRealmName to _npc.realm.split(" ").slice(0,-1).join(" ")>>
<<set _curRealmIdx to _realms.indexOf(_curRealmName)>>
<<if _curRealmIdx lt _realms.length - 1>>
<<set _npc.realm to _realms[_curRealmIdx + 1] + " early">>
<<UpdateNPCStatsForRealm _npc>>
<<set _text to `Heavenly phenomena were seen! ${_npc.fullname} has stepped into the ${_realms[_curRealmIdx + 1]}!`>>
<<else>>
<<set _text to `Rumours say ${_npc.fullname} is attempting core formation in seclusion... but nothing confirmed yet.`>>
<</if>>
<</if>>
<<case 7 to 9>> /* Tragic Death (3%) */
<<if !_npc.isDead>>
<<set _npc.isDead to true>>
<<set _npc.deathCause = "murder">>
<<set _npc.killedByPlayer = false>>
<<set _npc.killedInRevenge = false>>
/* If NPC had an active grudge, mention it */
<<if _npc.hasGrudge>>
<<set _text to `A bloodied jade slip arrived from ${_npc.NPClocation}: ${_npc.fullname} perished in a deadly ambush. Some say they were hunting someone... but their vengeance died with them.`>>
<<else>>
<<set _text to `A bloodied jade slip arrived from ${_npc.NPClocation}: ${_npc.fullname} perished in a deadly ambush. Their name fades from the Jianghu...`>>
<</if>>
<</if>>
<<case 10 to 19>> /* Saved villagers / Righteous act (10%) */
<<set _npc.RightTendencies to _npc.RightTendencies + random(15,35)>>
<<set _npc.depravity to Math.max(0, _npc.depravity - random(5,12))>>
<<set _text to `Travellers speak warmly of ${_npc.fullname}, who reportedly saved a mortal village from demonic beasts. Righteous aura grows stronger around them.`>>
<<case 20 to 29>> /* Massacred innocents / Demonic act (10%) */
<<set _npc.DemonTendencies to _npc.DemonTendencies + random(20,40)>>
<<set _npc.depravity to _npc.depravity + random(8,18)>>
<<set _text to `Dark whispers from ${_npc.NPClocation}: ${_npc.fullname} slaughtered an entire caravan of innocents. Blood qi swirls thicker around them now.`>>
<<case 30 to 39>> /* Left/Kicked from sect (10%) */
<<if _npc.sectNPC neq "Unaffiliated">>
<<set _oldSect to _npc.sectNPC>>
<<set _npc.sectNPC to "Unaffiliated">>
<<set _npc.NPCrank to "">>
<<set _text to `Shock in the cultivation world: ${_npc.fullname} has been expelled from the ${_oldSect}! Some say betrayal, others speak of forbidden techniques...`>>
<<else>>
<<set _text to `Merchants gossip that ${_npc.fullname} has taken on a mysterious new disciple in the wilderness.`>>
<</if>>
<<case 40 to 49>> /* Joined a sect (10%) */
<<if _npc.sectNPC is "Unaffiliated">>
<<set _newSect to ["Clear Sky Azure Dragon Pavilion", "Ghost King Netherworld Sect"].random()>>
<<set _npc.sectNPC to _newSect>>
<<set _npc.NPCrank to ["Disciple", "Member"].random()>>
<<set _text to `${_npc.fullname} has officially joined the ${_newSect}! Their future now lies with a major power.`>>
<<else>>
<<set _text to `Word is ${_npc.fullname} discovered an ancient ruin and emerged with valuable treasures.`>>
<</if>>
<<case 50 to 61>> /* Seclusion training (12%) */
<<set _npc.NPCinsight to _npc.NPCinsight + random(2,6)>>
<<set _npc.NPCbasewillpower to _npc.NPCbasewillpower + random(1,4)>>
<<set _text to `It is said ${_npc.fullname} has entered closed-door cultivation for months. Their foundation grows deeper...`>>
<<case 62 to 71>> /* Dual cultivation scandal / Charm increase (10%) */
<<set _npc.charm to _npc.charm + random(5,12)>>
<<set _npc.depravity to _npc.depravity + random(3,10)>>
<<set _text to `Taverns buzz with scandalous tales of ${_npc.fullname}'s passionate dual cultivation with a mysterious partner. Their charm has become almost bewitching.`>>
<<case 72 to 81>> /* Found treasure / Luck boost (10%) */
<<set _npc.NPCluck to _npc.NPCluck + random(3,8)>>
<<set _text to `Fortune smiles on ${_npc.fullname} — they discovered a hidden spirit herb garden deep in the mountains!`>>
<<case 82 to 91>> /* Injured in battle (10%) */
<<set _npc.NPCcurrenthealth to Math.max(1, _npc.NPCcurrenthealth - random(10,30))>>
<<set _text to `Grave news: ${_npc.fullname} was severely wounded in a fierce battle against a rival. They are recovering slowly...`>>
<<case 92 to 94>> /* Moved to new location (3%) */
<<set _oldLoc to _npc.NPClocation>>
<<set _newLoc to ["Jade Creek Town", "Northern Phoenix City", "Blood Sand Reach", "Hundred Sorrows Mountain"].random()>>
<<set _npc.NPClocation to _newLoc>>
<<set _text to `${_npc.fullname} has been spotted travelling towards ${_newLoc}. Perhaps they seek new opportunities there.`>>
<<case 95 to 97>> /* Memory of the dead (3%) */
<<if _npc.isDead>>
<<if _npc.killedByPlayer>>
<<if _npc.killedInRevenge>>
<<set _text to `Elderly cultivators sigh, remembering ${_npc.fullname} – a soul consumed by vengeance. "They died seeking justice... or perhaps madness."`>>
<<else>>
<<set _text to `Whispers speak of ${_npc.fullname}'s end at the hands of a mysterious cultivator. "Their killer walks free," they mutter.`>>
<</if>>
<<else>>
<<set _text to `Elderly cultivators sigh, remembering ${_npc.fullname}'s legendary sword technique. "If only they had lived longer..."`>>
<</if>>
<<else>>
<<set _text to `A wandering poet sings of ${_npc.fullname}'s deeds, comparing them to the immortals of old.`>>
<</if>>
<<case 98 to 99>> /* Rumours of revenge (2%) */
<<if $activeGrudges and $activeGrudges.length gt 0>>
<<set _randomGrudge to $activeGrudges.random()>>
<<set _text to `Whispers carry dark tidings: ${_randomGrudge.avengerName} hunts for the one who wronged ${_randomGrudge.victimName}. Vengeance is coming.`>>
<</if>>
<<default>> /* Pure flavor (10%) */
<<set _genderTerm to (_npc.gender is "female" ? "beauty" : "handsomeness")>>
<<set _flavors to [
`${_npc.fullname} was seen drinking alone under the moon in ${_npc.NPClocation}, lost in thought.`,
`Poets compose verses about ${_npc.fullname}'s peerless sword intent that split a waterfall in twain.`,
`Children in ${_npc.NPClocation} tell stories of how ${_npc.fullname} once flew across the sky on a sword of light.`,
`Old cultivators argue whether ${_npc.fullname}'s ${_genderTerm} comes from their cultivation or natural gift.`,
`A mysterious jade slip mentions ${_npc.fullname} will play a crucial role in the upcoming sect tournament.`,
`Merchants report seeing ${_npc.fullname} purchasing rare ingredients for a mysterious pill recipe.`
]>>
<<set _text to _flavors.random()>>
<</switch>>
<<if _text neq "">>
<div class="rumour-event">
<strong>◎ Rumour from the Jianghu ◎</strong><br>
<<print _text>>
</div>
<</if>>
<</if>>
<</if>>
<</widget>><!-- Arrogant Young Master Widgets -->
<<widget "set_aym_doggy_desc">>
<<set _random_desc_1 = $vagDoggyArrogantYMdesc.pluck()>>
<<set _random_desc_2 = $vagDoggyArrogantYMdesc.pluck()>>
<<set _random_desc_3 = $vagDoggyArrogantYMdesc.pluck()>>
<<set $vagDoggyArrogantYMdesc = [
"He fucks you hard - hands gripping your hips, teeth at your neck, hips slamming into you with practiced cruelty. Every thrust is punctuated by some mocking praise.",
"His cock drives deep from behind, your ass slapping against his hips with every punishing thrust. He uses you like a toy, panting with pleasure as he dominates you.",
"You feel completely exposed as he takes you from behind, one hand on your neck and the other spanking your ass between thrusts. There's no gentleness - just raw, possessive force.",
"He grabs your hair and pulls you back as he thrusts deeper. Your cries only make him grin harder - you’re being claimed, over and over again.",
"Bent over with your face pressed to the bedding, you can only moan as he ruts into you like a beast in heat. He fucks like he owns you, and in this moment, maybe he does."
]>>
<</widget>>
<<widget "set_aym_doggy_talk">>
<<set _random_talk_1 = $vagArrogantYMtalks.pluck()>>
<<set _random_talk_2 = $vagArrogantYMtalks.pluck()>>
<<set _random_talk_3 = $vagArrogantYMtalks.pluck()>>
<<set $vagArrogantYMtalks = [
"You moan like a whore.",
"Maybe I’ll keep you here. You’d look perfect leashed beneath my desk.",
"I knew you’d be good on all fours.",
"You're dripping like a bitch in heat. Don't pretend you're not loving this.",
"Say thank you, slut - thank me for fucking you.",
"No one's going to fuck you like this again. I ruin everything I use.",
"You're not even trying to resist anymore. Good. Know your place.",
"Do you like being used by someone above your station?"
]>>
<</widget>>
<<widget "set_aym_cowgirl_desc">>
<<set _random_desc_1 = $vagCowgirlArrogantYMdesc.pluck()>>
<<set _random_desc_2 = $vagCowgirlArrogantYMdesc.pluck()>>
<<set _random_desc_3 = $vagCowgirlArrogantYMdesc.pluck()>>
<<set $vagCowgirlArrogantYMdesc = [
"He pulls you into his lap, your back to his chest, and forces you down onto his cock, letting you ride him like a toy built for his pleasure.",
"His hand cracks down on your ass, sharp and loud, leaving a red mark that stings with each bounce.",
"You feel his cock throb deep inside as he guides your hips, fucking you from beneath while you moan helplessly."
]>>
<</widget>>
<<widget "set_aym_cowgirl_talk">>
<<set _random_talk_1 = $vagArrogantYMtalks.pluck()>>
<<set _random_talk_2 = $vagArrogantYMtalks.pluck()>>
<<set _random_talk_3 = $vagArrogantYMtalks.pluck()>>
<<set $vagArrogantYMtalks = [
"Louder. I want everyone outside to hear what a good whore you are.",
"You ride like you've done this before - don't lie to me.",
"That ass will carry my handprint for days. Perfect.",
"I could sit here all night and let you fuck yourself stupid on my cock."
]>>
<</widget>>
<<widget "set_aym_proneboneANAL_desc">>
<<set _random_desc_1 = $analProneArrogantYMdesc.pluck()>>
<<set _random_desc_2 = $analProneArrogantYMdesc.pluck()>>
<<set _random_desc_3 = $analProneArrogantYMdesc.pluck()>>
<<set $analProneArrogantYMdesc = [
"He shoves your face down into the cushion, lifting your hips and exposing your hole before pushing inside slowly, stretching you open inch by inch.",
"Each thrust is hard and deep, his hips smacking against your ass while your moans are muffled in the fabric beneath you.",
"He leans over your back, breathing hotly into your ear as he pounds into your ass like he owns it."
]>>
<</widget>>
<<widget "set_aym_proneboneANAL_talk">>
<<set _random_talk_1 = $analArrogantYMtalks.pluck()>>
<<set _random_talk_2 = $analArrogantYMtalks.pluck()>>
<<set _random_talk_3 = $analArrogantYMtalks.pluck()>>
<<set $analArrogantYMtalks = [
"Face down, ass up - just how I like my pets.",
"You’ll feel this every time you sit, and you’ll remember who did it to you.",
"Even your tight little hole can't resist me.",
"You're nothing but a hole for my pleasure now. Accept it."
]>>
<</widget>>
<<widget "AymFinisher">>
<<set _roll to random(1,3)>>
<<if _roll eq 1>>
<img src="images/Sex/vagCreampie.webp" class="nsfw-glow">>
<<set _finisher_desc_1 = $vagArrogantYMcumCreampie.pluck()>>
<<set $vagArrogantYMcumCreampie = [
"With a final, brutal thrust, he buries himself deep - your walls clamp around him just as hot spurts of cum flood your pussy. He grunts, grinding in to make sure it all stays inside.",
"He slams in and holds you tight, cock twitching as he fills you. Warm, thick seed spills deep, and he sighs in satisfaction like he just claimed a prize.",
"You feel his cock throb deep inside, and then the hot rush of release. His cum leaks from you almost instantly, but he stays buried, as if daring it to escape.",
"His rhythm falters, then stops - and he groans low as he spills into you. You can feel every pulse, every drop marking you from the inside.",
"He fucks you straight through his climax, pumping cum into you with each lingering thrust. It’s messy, filthy, and he clearly loves it that way."
]>>
<<set _finisher_talk_1 = $vagArrogantYMcumTalkCreampie.pluck()>>
<<set $vagArrogantYMcumTalkCreampie = [
"That's where you belong - dripping full of me.",
"Hope you weren’t planning on using that hole for anyone else.",
"Mmm. You feel better wrapped around my cock than anyone else has.",
"I’ll leave it in for a while - wouldn’t want it leaking out too soon.",
"Consider yourself claimed. You’ll be smelling like me for days."
]>>
<<elseif _roll eq 2>>
<img src="images/Sex/swallow.webp" class="nsfw-glow">>
<<set _finisher_desc_1 = $ArrogantYMcumMouth.pluck()>>
<<set $ArrogantYMcumMouth = [
"He shoves your head down, groaning as he cums. Hot, bitter seed hits the back of your throat in thick spurts, and he doesn’t let you up until you’ve swallowed every drop.",
"His cock pulses against your tongue as he fills your mouth. You can’t help but gag slightly, but he just grins and tells you to keep going - to take it all.",
"He moans low and steady, holding your head tight as he cums directly into your mouth. You’re left with no choice but to swallow or choke.",
"Warm cum floods your mouth as he finishes, and you can taste every humiliating drop. He pulls out slow and wipes the tip against your lips.",
"He cums hard, and you feel it fill your mouth almost instantly. It drips down your chin as he laughs and wipes the excess across your cheek."
]>>
<<set _finisher_talk_1 = $vagArrogantYMcumTalkMouth.pluck()>>
<<set $vagArrogantYMcumTalkMouth = [
"Swallow it all. Don’t waste a drop.",
"Good whore. Maybe I’ll let you taste it again sometime.",
"You make a decent cumdump, I’ll give you that.",
"Open wider next time. I want to see it pool on your tongue.",
"Keep your mouth open. I’m not done using it."
]>>
<<elseif _roll eq 3>>
<<set _random0 = random(0,1)>>
<<if _random0 eq 0>>
<img src="images/Sex/facial.webp" class="nsfw-glow"><<elseif _random0 eq 1>>
<img src="images/Sex/facial1.webp" class="nsfw-glow"><</if>>
<<set _finisher_desc_1 = $ArrogantYMcumFace.pluck()>>
<<set $ArrogantYMcumFace = [
"He jerks himself fast, then tilts your chin up - hot ropes of cum splash across your cheeks, lips, and nose. You feel it drip as he smirks.",
"With a low grunt, he strokes out thick spurts that land across your face - some hitting your forehead, others your lips. You’re painted in disgrace.",
"His cock twitches in his grip, then he releases - warm cum hitting your face in wet splashes, some getting in your hair. He looks proud of the mess.",
"You close your eyes just in time. Cum streaks across your face, running down your jaw and onto your collarbone. He chuckles and calls it an improvement.",
"He holds your face steady, aiming every pulse of cum directly onto your features. You're left dripping, sticky, and humiliated - just how he likes it."
]>>
<<set _finisher_talk_1 = $vagArrogantYMcumTalkFace.pluck()>>
<<set $vagArrogantYMcumTalkFace = [
"Now that’s a good look for you. So fucking pretty like this.",
"Smile for me. Let everyone see how I decorated you.",
"Stay still. I want to admire my work.",
"That’s what your face is good for - catching my cum.",
"Wipe it off? No. Walk around like that. Let them know."
]>>
<</if>>
<</widget>>
<<widget "AymTavernImg">>
<<if _position eq "doggy">>
<<set _random0 to random(0,1)>>
<<if _random0 eq 0>>
<img src="images/Sex/doggy.webp" class="nsfw-glow"><<elseif _random0 eq 1>>
<img src="images/Sex/doggy1.webp" class="nsfw-glow"><</if>>
<<elseif _position eq "cowgirl">>
<<set _random0 to random(0,2)>>
<<if _random0 eq 0>>
<img src="images/Sex/revcow.webp" class="nsfw-glow"><<elseif _random0 eq 1>>
<img src="images/Sex/revcow2.webp" class="nsfw-glow"><<elseif _random0 eq 2>>
<img src="images/Sex/revcow3.webp" class="nsfw-glow"><</if>>
<</if>>
<<if _penetration eq "anal">>
<<set _random0 to random(0,4)>>
<<if _random0 eq 0>>
<img src="images/Sex/pb.webp" class="nsfw-glow"><<elseif _random0 eq 1>>
<img src="images/Sex/pb1.webp" class="nsfw-glow"><<elseif _random0 eq 2>>
<img src="images/Sex/pb2.webp" class="nsfw-glow"><<elseif _random0 eq 3>>
<img src="images/Sex/pb3.webp" class="nsfw-glow"><<elseif _random0 eq 4>>
<img src="images/Sex/pb4.webp" class="nsfw-glow"><</if>>
<</if>>
<</widget>>
<!-- End of Arrogant Young Master Widgets --><<widget "SexDescription">>
<<set _img to $args[0]>>
<<set _partner to $args[1]>>
<<set _dominance to $args[2] ?? "neutral">>
<<set _gender to $args[3] ?? "male">>
<<set _d to "">>
/* ===================== START / FOREPLAY ===================== */
<<if ["foreplay1","foreplay2","kissing1","undressing",
"f_foreplay1","f_foreplay2","f_kissing1","f_undressing"].includes(_img)>>
<<if _dominance === "dom">>
<<if _gender === "female">>
<<set _d to "You shove " + _partner + " against the wall, taking what you want. Your hands roam her soft curves, commanding her responses as you grind your hips against hers, feeling her wetness soak through her robes.">>
<<else>>
<<set _d to "You shove " + _partner + " against the wall, taking what you want. Your hands roam his body, commanding his responses as you rub your core against his hardening length.">>
<</if>>
<<else>>
<<if _gender === "female">>
<<set _d to either(
_partner + " slams you against the wall, her hands pinning your wrists. She doesn't bother with your robes, instead sliding her hands inside the fabric to mash and squeeze your breasts. You can feel her thigh pressing aggressively between your legs, rubbing exactly where you ache the most.",
"She pulls you onto her lap, her fingers digging into the meat of your thighs. Her hands wander greedily under your layers, mapping the curve of your ass. Every time you shift, you feel her grinding her soaked core against yours, the friction through the silk layers making the ache in your pussy more demanding."
)>>
<<else>>
<<set _d to either(
_partner + " slams you against the wall, his heavy palms pinning your wrists while his knee shoves between your thighs to force them apart. He doesn't bother with your robes, instead sliding his rough hands inside the fabric to mash and squeeze your breasts until your nipples are bruised and hard. You can feel the thick, rigid length of his cock rubbing against your hip.",
"He pulls you onto his lap, his fingers digging into the meat of your thighs with enough force to leave marks. His hands wander greedily under your layers. Every time you shift, you feel his massive erection grinding against your entrance."
)>>
<</if>>
<</if>>
/* ===================== TEASING ===================== */
<<elseif ["teasing","f_teasing"].includes(_img)>>
<<if _gender === "female">>
<<set _d to "She slides a finger along the slit of your pussy, coating it in your own thick juices but refusing to push inside. She watches your hips jerk with a predatory smirk, enjoying the way your muscles twitch. She continues to circle your sensitive nub, applying just enough pressure to keep you on the edge without giving you the release you're begging for.">>
<<else>>
<<set _d to "He slides a finger along the slit of your pussy, coating it in your own thick juices but refusing to push inside. He watches your hips jerk and your back arch with a predatory smirk, enjoying the way your muscles twitch in a desperate attempt to pull him in.">>
<</if>>
/* ===================== NECK / KISSING ===================== */
<<elseif ["kissing_neck","neck_kiss","f_kissing_neck","f_neck_kiss"].includes(_img)>>
<<if _gender === "female">>
<<set _d to "She buries her face in the crook of your neck, sucking the skin so hard you can feel the capillaries bursting. She uses her teeth to nip at your throat, leaving dark, jagged marks. Her hands are busy mauling your waist, pulling you tightly against her soft, heated body.">>
<<else>>
<<set _d to "He buries his face in the crook of your neck, sucking the skin so hard you can feel the capillaries bursting under his tongue. He uses his teeth to nip and tear at your throat, leaving dark, jagged marks that will last for days.">>
<</if>>
/* ===================== KISSING (deep) ===================== */
<<elseif ["kissing_deep","kissing_intense","kissing_bite",
"f_kissing_deep","f_kissing_intense","f_kissing_bite"].includes(_img)>>
<<if _gender === "female">>
<<set _d to "Her mouth crashes against yours, her tongue pushing past your lips with a hunger that leaves you breathless. She bites your lower lip hard enough to sting, then soothes it with a slow, deliberate kiss.">>
<<else>>
<<set _d to "His mouth is bruising and demanding, his tongue forcing its way past yours. He swallows every sound you make, one hand fisted in your hair to keep you exactly where he wants you.">>
<</if>>
/* ===================== ORAL – GIVE (male partner) ===================== */
<<elseif ["blowjob1","blowjob2","blowjob_deep","kneeling_oral"].includes(_img)>>
<<set _d to either(
"You sink to your knees and wrap your lips around his thick, pulsing shaft, sliding down until your nose is buried in his pubic hair. You use your hands to stroke the base of his cock while your mouth works the top, your saliva slicking the entire length.",
"Your mouth is stretched to its limit as you take the full circumference of " + _partner + "'s cock. You bob your head in a steady, rhythmic pace, the wet slapping sound of your lips hitting his thighs filling the silence."
)>>
/* ===================== ORAL – GIVE (female partner) ===================== */
<<elseif ["f_cunnilingus_give1","f_cunnilingus_give2","f_licking1","f_kneeling_oral_give"].includes(_img)>>
<<set _d to "You part her thighs and bury your face between them. Your tongue relentlessly laps at her dripping slit, circling her swollen clit until her hips thrash against your mouth. She tangles her fingers in your hair, trying to push you deeper as she whimpers your name.">>
/* ===================== ORAL – RECEIVE ===================== */
<<elseif ["cunnilingus1","cunnilingus2","facesitting_light"].includes(_img)>>
<<set _d to _partner + " buries his face between your spread thighs. His tongue is merciless, lapping up your juices and flicking across your clit with expert, rapid strokes. Your back arches as you grab the sheets, completely at his mercy.">>
<<elseif ["f_cunnilingus_receive1","f_cunnilingus_receive2","f_facesitting1"].includes(_img)>>
<<set _d to _partner + " buries her face between your spread thighs. Her tongue is merciless, lapping up your juices and flicking across your clit with expert, rapid strokes. Your back arches as you grab the sheets, completely at her mercy.">>
/* ===================== HAND / MUTUAL ===================== */
<<elseif ["handjob1","handjob2","mutual_touch","hand_stroke"].includes(_img)>>
<<set _d to "His rough hand wraps around your wrist and guides your fingers to his throbbing length, showing you exactly how he wants it. You stroke him in slow, twisting pulls while he works two fingers knuckle-deep into your slick heat, curling them forward until you gasp.">>
<<elseif ["f_handjob1","f_mutual_touch","f_fingering_standing","f_hand_tease"].includes(_img)>>
<<set _d to "Her fingers find the slick heat between your thighs with practiced ease, working a slow, deliberate rhythm that makes your knees threaten to buckle. You press your hand against her in turn, feeling how wet she already is as you match her pace stroke for stroke.">>
/* ===================== VAGINAL – MALE ===================== */
<<elseif ["missionary","missionary2","missionary3","missionary_intense",
"cowgirl1","cowgirl_grind","doggy1","doggy",
"standingsex","standingsex1"].includes(_img)>>
<<if _dominance === "dom">>
<<set _d to "You straddle him, taking him inside you on your own terms. You set the agonizingly slow pace, making him beg before you finally slam down, seating him to the hilt.">>
<<else>>
<<set _d to either(
_partner + " pins your legs back against your chest and drives into you with a heavy, meat-on-meat thud. Each stroke is a violent intrusion, his thick shaft stretching your pussy to its absolute limit before pulling out almost entirely and slamming back in.",
"He buries his cock into you with one long, agonizingly deep lunge that hits your cervix, making your vision blur. He doesn't slow down, instead building a frantic rhythm that has your bodies sliding against each other in a mess of sweat and juices."
)>>
<</if>>
/* ===================== VAGINAL – FEMALE ===================== */
<<elseif ["f_fingering_deep1","f_fingering_deep2"].includes(_img)>>
<<set _d to _partner + " drives her fingers into you with ruthless precision, curling them forward to drag across that deep, sensitive spot. Her palm grinds against your clit with every thrust, forcing you to ride her hand as the pleasure builds to an almost unbearable pitch.">>
<<elseif ["f_tribbing1","f_tribbing2","f_scissoring1"].includes(_img)>>
<<set _d to "You and " + _partner + " lock your legs together, your swollen, dripping pussies pressed tightly against one another. Every time you grind your hips, the slick friction sends pure fire through your nerves. The sound of wet flesh meeting echoes in the room as you both chase your climax.">>
<<elseif ["f_strapon1","f_strapon2"].includes(_img)>>
<<set _d to _partner + " straps on a thick, rigid toy and drives it relentlessly into your dripping core. It lacks the warmth of flesh, but the brutal, unyielding hardness of it stretches you to the absolute limit as she pounds you into the bedding, matching a man's ferocity.">>
/* ===================== ANAL – MALE ===================== */
<<elseif ["anal1","anal_doggy","anal_standing"].includes(_img)>>
<<set _d to either(
_partner + " ignores your initial gasps of pain and shoves his thick head into your tight rear. He doesn't wait for you to adjust, instead forcing his way in inch by inch until he is buried to the hilt.",
"The sensation of being filled in your ass is absolute. " + _partner + " drives into your rear with a heavy, rhythmic pressure that makes your entire body shake."
)>>
/* ===================== ANAL – FEMALE ===================== */
<<elseif ["f_anal_fingering1","f_anal_fingering2"].includes(_img)>>
<<set _d to _partner + " works a slick finger slowly into your rear entrance, watching your face intently as she stretches you open. A second finger joins the first and she begins to thrust in a slow, deliberate rhythm, the deep fullness making you whimper into the sheets.">>
<<elseif ["f_strapon_anal1","f_strapon_anal2"].includes(_img)>>
<<set _d to _partner + " forces her way into your tight, forbidden entrance with the rigid toy. The stretch is agonizingly sharp before melting into a deep, throbbing fullness as she ruthlessly works your backdoor, her hips snapping forward with a ferocity that makes you cry out.">>
/* ===================== CLIMAX – MALE ===================== */
<<elseif ["creampie1","creampie2","missionary_creampie"].includes(_img)>>
<<set _d to either(
_partner + " jerks violently as he reaches his limit, slamming his cock into you as deep as it can go and holding it there. You feel the first hot jet of his seed hit your cervix, followed by pulse after pulse of thick, viscous fluid.",
"He lets out a guttural roar and shoves himself into you one last time, pinning you down as his cock twitches and sprays his hot release deep inside your core."
)>>
/* ===================== CLIMAX – FEMALE ===================== */
<<elseif ["f_mutual_climax1","f_mutual_climax2",
"f_climax_player1","f_climax_player2",
"f_climax_npc1","f_climax_npc2"].includes(_img)>>
<<set _d to "A high, broken wail escapes her lips as the climax shatters her control. Her body spasms violently against yours, her thighs clamping tight as she rides out every wave, completely spent and gasping for breath.">>
/* ===================== CLIMAX – MALE SHARED ===================== */
<<elseif ["mutual_climax1","mutual_climax2",
"climax_player1","climax_player2"].includes(_img)>>
<<set _d to "Your body seizes and arches, a broken cry tearing from your throat as the climax crashes through you. Every muscle locks tight before dissolving into shuddering, helpless tremors.">>
/* ===================== OTHER ===================== */
<<elseif ["cum_in_mouth1","swallow"].includes(_img)>>
<<set _d to "He rips his cock out of your pussy and shoves it into your mouth just as he starts to blow. Thick, hot ropes of cum hit the back of your throat, forcing you to swallow rhythmically to avoid choking.">>
<<elseif ["cum_on_chest1","cum_on_belly1"].includes(_img)>>
<<set _d to "He jerks himself off over your body. Thick, white ropes of cum splatter across your skin, landing with a wet sound and sticking to you instantly.">>
<</if>>
<<if _d neq "">>
<br><span class="sex-desc"><<print _d>></span>
<</if>>
<</widget>><<widget "Penetration_roll">>
<<set _roll to random(0,100)>>
<<if _roll lte 15>>
<<set _penetration to "anal">>
He's going for your ass!
<<else>>
<<set _penetration to "vaginal">>
He's going for your pussy.
<</if>>
<</widget>>
<!-- Universal Repeatable NSFW Scene Widget -->
<!--======================================== -->
<!--======================================== -->
<!--======================================== -->
<!--======================================== -->
<<widget "FinishScene">>
<<set _partner = $args[0]>>
<<set _sceneType = $args[1]>>
<<set _climaxType = $args[2] ?? "none">>
<<set _return = $args[3] ?? $passage>>
/* Scene‑type specific stat changes & logging */
<<if _sceneType eq "forced_npc">>
<<set $corruption = Math.min(100, $corruption + 10)>>
<<set _partner.friendship = Math.max(0, _partner.friendship - 15)>>
<<set _partner.depravity += 2>>
<<LogEvent "sex" "Spirit Shattered" `"Your dignity was trampled by " + _partner.fullname + " in a brutal encounter that stained your path to immortality."` 4 _partner.id _partner.fullname>>
<<elseif _sceneType eq "aggressive_player">>
<<set $corruption = Math.min(100, $corruption + 8)>>
<<set _partner.friendship = Math.max(0, _partner.friendship - 10)>>
<<set _partner.depravity += 3>>
<<LogEvent "sex" "Dominant Will" `"You imposed your will upon " + _partner.fullname + ", asserting your dominance in the realm of flesh."` 4 _partner.id _partner.fullname>>
<<elseif _sceneType eq "rape_player">>
<<set $corruption = Math.min(100, $corruption + 15)>>
<<set _partner.friendship = Math.max(0, _partner.friendship - 25)>>
<<set _partner.depravity += 5>>
<<LogEvent "sex" "Demonic Violation" `"A dark act committed against " + _partner.fullname + ", leaving their spirit broken and your own heart colder."` 5 _partner.id _partner.fullname>>
<<elseif _sceneType eq "consensual_flirt">>
<<set $corruption = Math.min(100, $corruption + 3)>>
<<set _partner.friendship = Math.min(100, _partner.friendship + 8)>>
<<set _partner.depravity += 1>>
<<LogEvent "sex" "Fated Entwinement" `"A night of shared breath and flowing Qi with " + _partner.fullname + " has strengthened your worldly bonds."` 2 _partner.id _partner.fullname>>
<<elseif _sceneType eq "consensual_seduce">>
<<set $corruption = Math.min(100, $corruption + 5)>>
<<set _partner.friendship = Math.min(100, _partner.friendship + 12)>>
<<set _partner.depravity += 2>>
<<LogEvent "sex" "Captivating the Spirit" `"Through charms and intent, you drew " + _partner.fullname + " into a night of profound dual pleasure."` 3 _partner.id _partner.fullname>>
<<elseif _sceneType eq "revenge_victory">>
<<set $corruption = Math.min(100, $corruption + 10)>>
<<set _partner.friendship = Math.max(0, _partner.friendship - 20)>>
<<set _partner.depravity += 8>>
<<set $sexFame += 5>>
<<LogEvent "sex" "Vanquished Pride" `"Having defeated " + _partner.fullname + " in combat, you claimed their dignity as your trophy."` 5 _partner.id _partner.fullname>>
<<elseif _sceneType eq "revenge_loss">>
<<set $corruption = Math.min(100, $corruption + 8)>>
<<set $sexFame += 5>>
<<LogEvent "sex" "Humbled by the Victor" `"Defeat led to deep humiliation; you were forced to submit to " + _partner.fullname + "'s vengeful desires."` 5 _partner.id _partner.fullname>>
<<elseif _sceneType eq "merchant">>
/* Generic merchant transaction – effects vary by reason string */
<<if $reason eq "blessing">>
<<set $corruption = Math.min(100, $corruption + random(2,4))>>
<<set $sexFame += 2>>
<<set $gold += 50>> /* the promised pill's value */
<<LogEvent "sex" "Merchant's Blessing" "You performed a 'blessing' for a merchant." 3>>
<<elseif $reason eq "tribute">>
<<set $corruption = Math.min(100, $corruption + random(3,5))>>
<<set $sexFame += 3>>
<<set $demonicreputation += 2>>
<<LogEvent "sex" "Demanded Tribute" "You forced a terrified merchant to service you sexually as tribute." 4>>
<<elseif $reason eq "aphrodisiacs">>
<<set $corruption = Math.min(100, $corruption + random(5,8))>>
<<set $sexFame += 4>>
<<set $gold += random(80,150)>>
<<LogEvent "sex" "Forbidden Transaction" "You accepted a merchant's lewd offer for a night of pleasure." 3>>
<<else>>
<<set $corruption = Math.min(100, $corruption + random(2,5))>>
<<set $sexFame += 2>>
<<LogEvent "sex" "Merchant Encounter" "You shared an intimate moment with a wandering merchant." 2>>
<</if>>
<<elseif _sceneType eq "brothel_hire">>
/* Hiring a courtesan */
<<set $corruption = Math.min(100, $corruption + random(2,4))>>
<<set $sexFame += 2>>
<<set $health = Math.min($maxhealth, $health + random(0,15))>> /* Optional pleasure boost */
<<LogEvent "sex" "Brothel Visit" `"You spent a night with " + _partner.fullname + " at the Crimson Blossom."` 2>>
<<elseif _sceneType eq "brothel_work">>
<<set $corruption = Math.min(100, $corruption + random(3,6))>>
<<set $sexFame += 4>>
<<set $gold += random(80, 200)>>
<<LogEvent "sex" "Brothel Work" "You worked a night at the Crimson Blossom, earning spirit stones." 3>>
<<elseif _sceneType eq "mission_sex">>
/* Generic mission sex handler – uses $currentMissionEffects */
<<MissionFinishAuto>>
<<if $currentMissionEffects>>
<<set $corruption = Math.min(100, $corruption + $currentMissionEffects.corruption)>>
<<set $sexFame += $currentMissionEffects.sexFame>>
<<if $currentMissionEffects.righteousreputation != 0>>
<<set $righteousreputation = Math.max(0, $righteousreputation + $currentMissionEffects.righteousreputation)>>
<</if>>
<<unset $currentMissionEffects>>
<<unset $missionDominance>>
/* Complete the mission (assumes MissionFinish widget exists) */
<</if>>
<</if>>
/* Climax‑type bonuses (only apply if partner is a real NPC with stats) */
<<if _partner and _partner.friendship is not undefined>>
<<if _climaxType eq "mutual">>
<<set $corruption = Math.min(100, $corruption + 1)>>
<<set _partner.friendship = Math.min(100, _partner.friendship + 2)>>
<<elseif _climaxType eq "player_first">>
<<set $corruption = Math.min(100, $corruption + 2)>>
<<set _partner.friendship = Math.min(100, _partner.friendship + 1)>>
<<elseif _climaxType eq "npc_first">>
<<set $corruption = Math.min(100, $corruption + 1)>>
<<set _partner.depravity += 2>>
<<elseif _climaxType eq "forced_by_player">>
<<set $corruption = Math.min(100, $corruption + 5)>>
<<set _partner.friendship = Math.max(0, _partner.friendship - 5)>>
<</if>>
<</if>>
<<if _partner and _partner.friendship is not undefined>>
/* Update the NPC in the known list */
<<set _index = $known_npc_list.findIndex(function(n) { return n.id === _partner.id; })>>
<<if _index >= 0>>
<<set $known_npc_list[_index] = _partner>>
<</if>>
<</if>>
/* Always add general sex fame (small) */
<<set $sexFame += random(1,2)>>
/* Clean up temporary variables used for the sex scene */
<<unset $sexPartner>>
<<unset $sexType>>
<<unset $sexReturnPassage>>
<<unset $reason>>
<<unset $missionDominance>>
<<unset $currentMissionEffects>>
<<goto _return>>
<</widget>>
<<widget "CasualSex">>
<<set _partnerArg to $args[0] ?? "your partner">>
<<set _reason to $args[1] ?? "for pleasure">>
<<set _dominance to $args[2] ?? "neutral">>
<<set _mode to $args[3] ?? "full">>
<<set _return to $args[4] ?? $passage>>
<<set _scene = $args[5] ?? null>>
<<set _originalType = $args[6] ?? "casual">>
<<set _isNPC = (_partnerArg and _partnerArg.fullname and _partnerArg.gender)>>
<<if not _scene or typeof _scene !== "object">>
<<set _scene = {
position: "start",
playerArousal: 0,
npcArousal: 0,
finished: false,
playerClimaxed: false,
npcClimaxed: false,
partner: _isNPC ? _partnerArg : null,
partnerName: _isNPC ? _partnerArg.fullname : _partnerArg,
partnerGender: _isNPC ? _partnerArg.gender : "male",
originalType: _originalType
}>>
<</if>>
<<set _arousalGains = {
"start": {player: 5, npc: 5},
"kissing": {player: 8, npc: 8},
"oral-give": {player: 6, npc: 12},
"oral-receive": {player: 12, npc: 6},
"hand": {player: 7, npc: 7},
"vaginal": {player: 15, npc: 12},
"anal": {player: 18, npc: 10}
}>>
<<set _partnerName = _scene.partnerName>>
<<set _partnerGender = _scene.partnerGender>>
<<set _pSubj = _partnerGender === "male" ? "he" : "she">>
<<set _pObj = _partnerGender === "male" ? "him" : "her">>
<<set _pPos = _partnerGender === "male" ? "his" : "her">>
<<set _pRefl = _partnerGender === "male" ? "himself" : "herself">>
<<set _partnerLinesMale = ["Good girl...", "Take it all", "You're so tight", "Just like that", "Beg for it", "You feel amazing", "I'm close...", "Swallow it all", "Hold still", "So wet for me", "That's it...", "You love this", "Deeper?", "You're perfect", "Such a good slut"]>>
<<set _partnerLinesFemale = ["Good boy...", "Take it all", "You're so hard", "Just like that", "Beg for it", "You feel amazing", "I'm close...", "Swallow it all", "Hold still", "So hard for me", "That's it...", "You love this", "Deeper?", "You're perfect", "Such a good slut"]>>
<<set _partnerLines = _partnerGender === "male" ? _partnerLinesMale : _partnerLinesFemale>>
<<if $corruption gte 70>>
<<set _playerMoans to $playerSexLinesCorrupt>>
<<elseif $corruption gte 30>>
<<set _playerMoans to $playerSexLinesNormal>>
<<else>>
<<set _playerMoans to $playerSexLinesPure>>
<</if>>
<div id="casualSexContainer">
<<if _scene.position === "start">>
<br><br>
<<if _dominance === "dom">>
<<if _partnerGender === "male">>
You press <<print _partnerName>> against the wall, taking full control. <span class="player">"You're going to make this worth my time."</span>
<<else>>
You push <<print _partnerName>> onto the bed, straddling her with a hungry grin. <span class="player">"You're mine tonight."</span>
<</if>>
<<elseif _dominance === "sub">>
<<if _partnerGender === "male">>
<<print _partnerName>> grabs your hips firmly and pushes you down. <span class="partner-male">"You'll earn every drop of that reward."</span>
<<else>>
<<print _partnerName>> pulls you close by the collar, her eyes dark with intent. <span class="partner-female">"Be a good girl and do as I say."</span>
<</if>>
<<else>>
<<if _partnerGender === "male">>
You both crash together, robes tearing in frantic need - no words, just raw hunger.
<<else>>
You tumble together onto the sheets, lips and hands everywhere at once, neither of you willing to slow down.
<</if>>
<</if>>
<</if>>
<div id="sexDisplay">
<<set _img = "">>
/* ===================== START ===================== */
<<if _scene.position === "start">>
<<if _partnerGender === "male">>
<<set _img to ["foreplay1","foreplay2","kissing1","teasing","undressing"].random()>>
Robes fall to the ground in a hurried pile. Hands roam greedily over bare skin, pulling you close as your lips meet in a heated kiss.
<<else>>
<<set _img to ["f_foreplay1","f_foreplay2","f_kissing1","f_teasing","f_undressing"].random()>>
Her hands slip beneath your clothes with practiced ease. You pull her against you, mouths meeting in a slow, deep kiss that quickly turns urgent.
<</if>>
<<set _moan to _playerMoans.random()>><br><span class="player">"<<print _moan>>"</span>
<<set _line to _partnerLines.random()>><br><span class="partner-<<print _partnerGender>>">"<<print _line>>"</span>
<</if>>
/* ===================== KISSING ===================== */
<<if _scene.position === "kissing">>
<<if _partnerGender === "male">>
<<set _img to ["kissing_deep","kissing_intense","kissing_bite","neck_kiss"].random()>>
Your mouths fuse together in a fierce battle of tongues.
<<else>>
<<set _img to ["f_kissing_deep","f_kissing_intense","f_kissing_bite","f_neck_kiss"].random()>>
She cups your face and kisses you deeply, her tongue sliding against yours in a slow, deliberate dance.
<</if>>
<<set _moan to _playerMoans.random()>><br><span class="player">"<<print _moan>>"</span>
<<set _line to _partnerLines.random()>><br><span class="partner-<<print _partnerGender>>">"<<print _line>>"</span>
<</if>>
/* ===================== ORAL - GIVE ===================== */
<<if _scene.position === "oral-give">>
<<if _partnerGender === "male">>
<<set _img to ["blowjob1","blowjob2","blowjob_deep","kneeling_oral"].random()>>
You sink to your knees, looking up at <<print _partnerName>>. You take <<print _pPos>> hard length into your mouth. Your tongue swirls slowly at first, then faster, drawing groans from <<print _pObj>>.
<<else>>
<<set _img to ["f_cunnilingus_give1","f_cunnilingus_give2","f_licking1","f_kneeling_oral_give"].random()>>
You press <<print _partnerName>> back and bury your face between her thighs. Your tongue parts her folds eagerly, tracing slow circles around her clit until her hips roll against your mouth.
<</if>>
<<set _line to _partnerLines.random()>><br><span class="partner-<<print _partnerGender>>">"<<print _line>>"</span>
<<set _moan to _playerMoans.random()>><br><span class="player">"<<print _moan>>"</span>
<</if>>
/* ===================== ORAL - RECEIVE ===================== */
<<if _scene.position === "oral-receive">>
<<if _partnerGender === "male">>
<<set _img to ["cunnilingus1","cunnilingus2","facesitting_light"].random()>>
Your thighs are spread wide, <<print _pPos>> face buried between them. <<print _pSubj>> tongue dances over your sensitive folds, teasing and sucking with expert precision.
<<else>>
<<set _img to ["f_cunnilingus_receive1","f_cunnilingus_receive2","f_facesitting1"].random()>>
<<print _partnerName>> dips her head between your legs, her tongue working your most sensitive spot with practiced patience. You grip the sheets as she pulls you apart piece by piece.
<</if>>
<<set _moan1 to _playerMoans.random()>>
<<set _moan2 to _playerMoans.random()>><br><span class="player">"<<print _moan1>> <<print _moan2>>"</span>
<<set _line to _partnerLines.random()>><br><span class="partner-<<print _partnerGender>>">"<<print _line>>"</span>
<</if>>
/* ===================== HAND ===================== */
<<if _scene.position === "hand">>
<<if _partnerGender === "male">>
<<set _img to ["handjob1","handjob2","mutual_touch","hand_stroke"].random()>>
Hands wrap around each other, stroking and teasing slick, heated flesh. Fingers slide and pump in perfect rhythm, building tension with every touch.
<<else>>
<<set _img to ["f_handjob1","f_mutual_touch","f_fingering_standing","f_hand_tease"].random()>>
Her fingers find their way between your legs, stroking and teasing with confident precision while your own hand presses against her warmth. You work each other in breathless rhythm.
<</if>>
<<set _moan to _playerMoans.random()>><br><span class="player">"<<print _moan>>"</span>
<<set _line to _partnerLines.random()>><br><span class="partner-<<print _partnerGender>>">"<<print _line>>"</span>
<</if>>
/* ===================== VAGINAL ===================== */
<<if _scene.position === "vaginal" and ["full","vaginal"].includes(_mode)>>
<<if _partnerGender === "male">>
<<set _img to ["missionary","missionary2","missionary3","cowgirl1","doggy1","doggy","standingsex","standingsex1","missionary_intense","cowgirl_grind"].random()>>
<<print _partnerName>> slides deep into your dripping pussy with powerful thrusts. Each stroke fills you completely, hitting every sensitive spot as the pace turns frantic.
<<else>>
<<set _img to ["f_fingering_deep1","f_fingering_deep2","f_tribbing1","f_tribbing2","f_scissoring1","f_strapon1","f_strapon2"].random()>>
<<print _partnerName>> presses deep into you - fingers curling, hips rolling - filling you with relentless rhythm. Her free hand grips your thigh as she drives you closer to the edge.
<</if>>
<<set _moan1 to _playerMoans.random()>>
<<set _moan2 to _playerMoans.random()>><br><span class="player">"<<print _moan1>> <<print _moan2>> Yes-!"</span>
<<set _line to _partnerLines.random()>><br><span class="partner-<<print _partnerGender>>">"<<print _line>>"</span>
<</if>>
/* ===================== ANAL ===================== */
<<if _scene.position === "anal" and ["full","anal"].includes(_mode)>>
<<if _partnerGender === "male">>
<<set _img to ["anal1","anal_doggy","anal_standing"].random()>>
<<print _partnerName>> slowly presses into your tight rear entrance. The stretch is intense, overwhelming - <<print _pSubj>> gives you a moment, then begins thrusting deeper and harder.
<<else>>
<<set _img to ["f_anal_fingering1","f_anal_fingering2","f_strapon_anal1","f_strapon_anal2"].random()>>
<<print _partnerName>> works a slick finger slowly into your rear entrance, watching your face as she stretches you. A second finger joins the first, and she begins to thrust in a slow, deliberate rhythm that leaves you breathless.
<</if>>
<<set _moan to _playerMoans.random()>><br><span class="player">"<<print _moan>> It's too much... ahh!"</span>
<<set _line to _partnerLines.random()>><br><span class="partner-<<print _partnerGender>>">"<<print _line>>"</span>
<</if>>
<<if _img !== "">>
<img @src="'images/Sex/' + _img + '.webp'" class="nsfw-glow">
<<SexDescription _img _partnerName _dominance _partnerGender>>
<</if>>
</div>
<<if not _scene.finished>>
<div class="arousal-info" style="font-size:0.8em; opacity:0.7;">
Your arousal: <<print _scene.playerArousal>> / <<print $maxArousal>><br>
<<print _partnerName>>'s arousal: <<print _scene.npcArousal>> / <<print $maxArousal>>
</div>
<<set _climaxReady = (_scene.playerArousal >= $maxArousal or _scene.npcArousal >= $maxArousal)>>
<<if not _climaxReady>>
<p><strong>Continue...</strong></p>
<ul>
<<if _scene.position !== "">>
<li><<linkreplace "Continue in this position">>
<<set _newScene = Object.assign({}, _scene)>>
<<set _newScene.playerArousal = Math.min($maxArousal, _newScene.playerArousal + _arousalGains[_newScene.position].player)>>
<<set _newScene.npcArousal = Math.min($maxArousal, _newScene.npcArousal + _arousalGains[_newScene.position].npc)>>
<<replace "#casualSexContainer">><<CasualSex _partnerArg _reason _dominance _mode _return _newScene _originalType>><</replace>>
<</linkreplace>></li>
<</if>>
<<if ["foreplay","full"].includes(_mode) and _scene.position !== "kissing">>
<li><<linkreplace "Passionate kissing">>
<<set _newScene = Object.assign({}, _scene)>>
<<set _newScene.position = "kissing">>
<<set _newScene.playerArousal = Math.min($maxArousal, _newScene.playerArousal + _arousalGains["kissing"].player)>>
<<set _newScene.npcArousal = Math.min($maxArousal, _newScene.npcArousal + _arousalGains["kissing"].npc)>>
<<replace "#casualSexContainer">><<CasualSex _partnerArg _reason _dominance _mode _return _newScene _originalType>><</replace>>
<</linkreplace>></li>
<</if>>
<<if ["oral","full"].includes(_mode)>>
<<if _scene.position !== "oral-give">>
<li><<linkreplace "Give oral">>
<<set _newScene = Object.assign({}, _scene)>>
<<set _newScene.position = "oral-give">>
<<set _newScene.playerArousal = Math.min($maxArousal, _newScene.playerArousal + _arousalGains["oral-give"].player)>>
<<set _newScene.npcArousal = Math.min($maxArousal, _newScene.npcArousal + _arousalGains["oral-give"].npc)>>
<<replace "#casualSexContainer">><<CasualSex _partnerArg _reason _dominance _mode _return _newScene _originalType>><</replace>>
<</linkreplace>></li>
<</if>>
<<if _scene.position !== "oral-receive">>
<li><<linkreplace "Receive oral">>
<<set _newScene = Object.assign({}, _scene)>>
<<set _newScene.position = "oral-receive">>
<<set _newScene.playerArousal = Math.min($maxArousal, _newScene.playerArousal + _arousalGains["oral-receive"].player)>>
<<set _newScene.npcArousal = Math.min($maxArousal, _newScene.npcArousal + _arousalGains["oral-receive"].npc)>>
<<replace "#casualSexContainer">><<CasualSex _partnerArg _reason _dominance _mode _return _newScene _originalType>><</replace>>
<</linkreplace>></li>
<</if>>
<</if>>
<<if ["hand","full"].includes(_mode) and _scene.position !== "hand">>
<li><<linkreplace "Manual play">>
<<set _newScene = Object.assign({}, _scene)>>
<<set _newScene.position = "hand">>
<<set _newScene.playerArousal = Math.min($maxArousal, _newScene.playerArousal + _arousalGains["hand"].player)>>
<<set _newScene.npcArousal = Math.min($maxArousal, _newScene.npcArousal + _arousalGains["hand"].npc)>>
<<replace "#casualSexContainer">><<CasualSex _partnerArg _reason _dominance _mode _return _newScene _originalType>><</replace>>
<</linkreplace>></li>
<</if>>
<<if ["vaginal","full"].includes(_mode) and _scene.position !== "vaginal">>
<<set _vaginalLabel = _partnerGender === "male" ? "Vaginal penetration" : "Finger her / Trib">>
<li><<linkreplace _vaginalLabel>>
<<set _newScene = Object.assign({}, _scene)>>
<<set _newScene.position = "vaginal">>
<<set _newScene.playerArousal = Math.min($maxArousal, _newScene.playerArousal + _arousalGains["vaginal"].player)>>
<<set _newScene.npcArousal = Math.min($maxArousal, _newScene.npcArousal + _arousalGains["vaginal"].npc)>>
<<replace "#casualSexContainer">><<CasualSex _partnerArg _reason _dominance _mode _return _newScene _originalType>><</replace>>
<</linkreplace>></li>
<</if>>
<<if ["anal","full"].includes(_mode) and _scene.position !== "anal">>
<<set _analLabel = _partnerGender === "male" ? "Anal penetration" : "Anal fingering">>
<li><<linkreplace _analLabel>>
<<set _newScene = Object.assign({}, _scene)>>
<<set _newScene.position = "anal">>
<<set _newScene.playerArousal = Math.min($maxArousal, _newScene.playerArousal + _arousalGains["anal"].player)>>
<<set _newScene.npcArousal = Math.min($maxArousal, _newScene.npcArousal + _arousalGains["anal"].npc)>>
<<replace "#casualSexContainer">><<CasualSex _partnerArg _reason _dominance _mode _return _newScene _originalType>><</replace>>
<</linkreplace>></li>
<</if>>
</ul>
<<else>>
<<set _playerClimaxed = (_scene.playerArousal >= $maxArousal)>>
<<set _npcClimaxed = (_scene.npcArousal >= $maxArousal)>>
<<if _playerClimaxed and _npcClimaxed>>
<<set _climaxType = "mutual">>
<<elseif _playerClimaxed>>
<<set _climaxType = "player">>
<<else>>
<<set _climaxType = "npc">>
<</if>>
<div id="climax-options">
<<if _climaxType === "mutual">>
<<linkreplace "Climax together">>
<<replace "#casualSexContainer">>
<div id="sexDisplay">
<<if _partnerGender === "male">>
<<set _img to ["mutual_climax1","mutual_climax2"].random()>>
<<else>>
<<set _img to ["f_mutual_climax1","f_mutual_climax2"].random()>>
<</if>>
<img @src="'images/Sex/' + _img + '.webp'" class="nsfw-glow">
You both lose control at the same moment - bodies locked, trembling in shared ecstasy as waves of pleasure crash through you.
<<set _moan to _playerMoans.random()>><br><span class="player">"<<print _moan>>"</span>
<<set _line to _partnerLines.random()>><br><span class="partner-<<print _partnerGender>>">"<<print _line>>"</span>
<br><br>Breathless and spent, the deal is sealed.
</div>
<br><<link "Return">><<FinishScene _scene.partner _scene.originalType "mutual" _return>><</link>>
<</replace>>
<</linkreplace>>
<<elseif _climaxType === "player">>
<<linkreplace "Climax on your own">>
<<replace "#casualSexContainer">>
<div id="sexDisplay">
<<if _partnerGender === "male">>
<<set _img to ["climax_player1","climax_player2"].random()>>
<<else>>
<<set _img to ["f_climax_player1","f_climax_player2"].random()>>
<</if>>
<img @src="'images/Sex/' + _img + '.webp'" class="nsfw-glow">
Your body arches, a cry escaping your lips as you reach your peak alone.
<<set _moan to _playerMoans.random()>><br><span class="player">"<<print _moan>>"</span>
<<set _line to _partnerLines.random()>><br><span class="partner-<<print _partnerGender>>">"<<print _line>>"</span>
<br><br>You collapse, sated.
</div>
<br><<link "Return">><<FinishScene _scene.partner _scene.originalType "player_first" _return>><</link>>
<</replace>>
<</linkreplace>>
<<else>>
<<if _dominance === "dom">>
<<set _forcedLabel = _partnerGender === "male" ? "Force them to finish inside" : "Make her finish">>
<<linkreplace _forcedLabel>>
<<replace "#casualSexContainer">>
<div id="sexDisplay">
<<if _partnerGender === "male">>
<<set _img to ["creampie1","creampie2","missionary_creampie"].random()>>
<<print _partnerName>> groans and you force <<print _pObj>> deep, feeling <<print _pPos>> pulse as <<print _pSubj>> fills you.
<<else>>
<<set _img to ["f_climax_npc1","f_climax_npc2"].random()>>
You press <<print _partnerName>> over the edge, her whole body shuddering as she comes undone beneath your hands.
<</if>>
<img @src="'images/Sex/' + _img + '.webp'" class="nsfw-glow">
<<SexDescription _img _partnerName _dominance _partnerGender>>
<<set _moan to _playerMoans.random()>><br><span class="player">"<<print _moan>>"</span>
<br><br>You've claimed <<print _pObj>>.
</div>
<br><<link "Return">><<FinishScene _scene.partner _scene.originalType "forced_by_player" _return>><</link>>
<</replace>>
<</linkreplace>>
<<else>>
<<set _letFinishLabel = _partnerGender === "male" ? "Let them finish" : "Let her finish">>
<<linkreplace _letFinishLabel>>
<<replace "#casualSexContainer">>
<div id="sexDisplay">
<<if _partnerGender === "male">>
<<set _img to ["creampie1","creampie2","missionary_creampie"].random()>>
<<print _partnerName>> releases inside you, <<print _pPos>> warmth spreading.
<<else>>
<<set _img to ["f_climax_npc1","f_climax_npc2"].random()>>
<<print _partnerName>> shudders against you, a soft cry on her lips as she crests and falls, clinging to you through every wave.
<</if>>
<img @src="'images/Sex/' + _img + '.webp'" class="nsfw-glow">
<<SexDescription _img _partnerName _dominance _partnerGender>>
<<set _moan to _playerMoans.random()>><br><span class="player">"<<print _moan>>"</span>
<<set _line to _partnerLines.random()>><br><span class="partner-<<print _partnerGender>>">"<<print _line>>"</span>
<br><br>It's over.
</div>
<br><<link "Return">><<FinishScene _scene.partner _scene.originalType "npc_first" _return>><</link>>
<</replace>>
<</linkreplace>>
<</if>>
<</if>>
</div>
<</if>>
<</if>>
<<if _scene.position === "vaginal" and $virginity == 1 and _partnerGender === "male">>
<<set $virginity to 0>>
<<set $virginityLost to _partnerName>>
<span class="red">You lost your virginity to <<print _partnerName>>!</span><br>
<</if>>
<<if _scene.position === "anal" and $analVirginity == 1 and _partnerGender === "male">>
<<set $analVirginity to 0>>
<<set $analVirginityLost to _partnerName>>
<span class="red">You lost your anal virginity to <<print _partnerName>>!</span><br>
<</if>>
</div>
<</widget>><div class="xianxia-wide-container">
<!-- Center Column: Full Body Form -->
<div class="xianxia-col portrait-panel">
<div class="main-portrait-wrapper">
<img src="images/Character/hf1.png" alt="Full Body Form">
</div>
<div class="xianxia-workspace">
<!-- Left Column: Multi-stage Closeups -->
<div class="xianxia-col closeups-panel">
<div class="panel-title">Vessel Closeups</div>
<div class="closeup-grid">
<!-- Breasts: Stage 1 & 2 -->
<div class="closeup-box">
<div class="stage-label">Stage 1</div>
<img src="images/Character/hb1.png" alt="Breasts Stage 1">
<div class="closeup-desc">Soft and supple</div>
</div>
<!-- Mouth: Stage 1 & 2 -->
<div class="closeup-box">
<div class="stage-label">Stage 1</div>
<img src="images/Character/hm1.png" alt="Mouth Stage 1">
<div class="closeup-desc">Pouty and defiant</div>
</div>
<!-- Vagina: Stage 1 & 2 -->
<div class="closeup-box">
<div class="stage-label">Stage 1</div>
<img src="images/Character/hp1.png" alt="Vagina Stage 1">
<div class="closeup-desc">Sealed and pristine</div>
</div>
<!-- Buttocks: Stage 1 & 2 -->
<div class="closeup-box">
<div class="stage-label">Stage 1</div>
<img src="images/Character/ha1.png" alt="Buttocks Stage 1">
<div class="closeup-desc">Firm and alluring</div>
</div>
</div>
</div>
<!-- Right Column: Descriptions & Carnal Records -->
<div class="xianxia-col data-panel">
<div class="description-block">
<div class="desc-line"><strong>Mouth:</strong> <span>Enticing and full of promise</span></div>
<div class="desc-line"><strong>Breasts:</strong> <span>Fat tits jiggle with every step you take, demanding attention with their soft warmth.</span></div>
<div class="desc-line"><strong>Vagina:</strong> <span>Unmarred and pristine, tightly sealed.</span></div>
<div class="desc-line"><strong>Buttocks:</strong> <span>Full and enticing, drawing illicit gazes with each movement.</span></div>
</div>
<div class="horizontal-divider"></div>
<div class="panel-title">Records</div>
<table class="stats-table">
<b>Corruption</b>: $corruption
<tr>
<td>Human Encounters:</td>
<td><<print $humanSexCount || 0>></td>
<td>Seductions:</td>
<td><<print $seductions || 0>></td>
</tr>
<tr>
<td>Monster Encounters:</td>
<td><<print $monsterSexCount || 0>></td>
<td>Pushed Down:</td>
<td><<print $pushedDown || 0>></td>
</tr>
<tr>
<td>Sexually Harassed:</td>
<td><<print $harassedCount || 0>></td>
<td>Oral Acts:</td>
<td><<print $oralCount || 0>></td>
</tr>
<tr>
<td>Toys Used:</td>
<td><<print $toysUsed || 0>></td>
<td>Anal Acts:</td>
<td><<print $analCount || 0>></td>
</tr>
<tr>
<td>Primal Yin Seal:</td>
<td colspan="3">
<<if $virginity eq 1>>
<span class="status-pristine">Intact (Pure Lotus)</span>
<<else>>
<span class="status-broken">Shattered by <<print $virginityLost>></span>
<</if>>
</td>
</tr>
</table>
<div class="xianxia-action-row">
<<link "Roll Up the Scroll" "Status" >><</link>>
</div>
</div>
</div>
</div><<widget "CityGatesClosed">>
<style>
.choice-taken { opacity: 0.35; pointer-events: none; cursor: default; }
</style>
<p>The gates of Phoenix City rise before you — red-lacquered timber and ironwood beams, the city seal burned deep into the stone arch above, the City Lord's mark unmistakable. Two guards in polished bronze armor hold their halberds crossed at the entrance. A third watches from the gatehouse above.</p>
<p>The guard on the left steps forward. <span class="male1">"City is closed to outside entry. City Lord's direct order — no admittance until the seal is lifted. No exceptions."</span></p>
<p>He holds your gaze, waiting.</p>
<<set _variant to random(1, 4)>>
<!-- ══════════════════════════════════
LEGEND (5801+)
══════════════════════════════════ -->
<<if $totalFame gte 5801>>
<<if $sexFame gte 100 || random(1,100) lte 40>>
<p>The guard trails off mid-sentence — then forgets what he was saying entirely. His eyes move over you slowly. His partner on the right has stopped pretending to look at the road.</p>
<p>The gate captain descends from the gatehouse. He recognizes you. That much is clear from the way his posture shifts. But the recognition sits alongside something else — the particular attention of a man who has decided that rank only goes so far.</p>
<p><span class="male1">"The honored <<print $CurrentPcSectRank>>."</span> He clasps his hands. Bows — but not as low as he should. <span class="male1">"Your reputation precedes you. Both of them."</span> A pause that carries meaning. <span class="male1">"The City Lord's seal is beyond my authority to lift. However… a woman of your particular fame travelling alone — it would be remiss of us not to offer an escort to the outer pavilion."</span></p>
<div class="choices" id="gate-choices">
<<link "Accept the escort — and what it implies">>
<<replace "#gate-choices">>
<p class="choice-taken">Accept the escort — and what it implies</p>
<p class="choice-taken">Remind him exactly who he is speaking to</p>
<</replace>>
<<replace "#gate-body">>
<p>You hold the captain's gaze for a moment, then glance at the pavilion. <span class="player">"Lead the way."</span></p>
<<if _variant is 1>>
<!-- FULL FILTHY SEX -->
<p>The outer pavilion is perfectly private. The captain sends the others away and immediately presses you against a lacquered pillar, mouth devouring your neck as he rips your robes open. The silk tears easily, revealing your bare flesh to the cool air.</p>
<p>He sucks hard on your breasts, drawing each nipple into his mouth while his hands roam across your body. His fingers trace the curve of your waist, your hips, then dip lower. You gasp as he drops to his knees and buries his tongue deep in your soaking cunt, lapping greedily while his fingers pump into you with practiced precision.</p>
<img src="images/Sex/gate_legend_fuck1.webp" class="nsfw-glow">
<p>He rises, his arousal evident, and bends you over the lacquered table. Without preamble he slides his thick cock into your cunt, stretching you as he begins with long, powerful strokes. Your heavenly gates grip him tightly and your qi surges wildly with every thrust, building higher and higher. The table creaks beneath you both as he pounds into you, one hand gripping your hair, the other pressed against your lower belly so he can feel himself driving deep inside you.</p>
<p>Later he pulls you onto his lap, making you straddle him as he sinks back into the chair. You ride him, controlling the pace as his mouth finds your breasts again, sucking and biting gently at your sensitive nipples. Your muscles tighten around his cock and soon he's groaning, flooding your womb with thick ropes of yang essence, his essence mingling with your yin in perfect cultivation balance.</p>
<img src="images/Sex/gate_legend_fuck2.webp" class="nsfw-glow">
<<elseif _variant is 2>>
<!-- HEAVY GROPING + FINGERING -->
<p>He spends a long time "inspecting" you with rough hands that roam your body with casual ownership. He squeezes your breasts, testing their weight, pinching your nipples until they harden beneath his touch. His gaze is hungry as he forces you to stand still for his examination.</p>
<p>He pulls you close and spins you around, bending you forward over the table. Your robes are pushed up and he runs his palms across your ass, gripping and kneading the soft flesh before spreading your cheeks. Two thick fingers plunge into your cunt without warning, pumping in and out while another teases your tight asshole. He fingers you relentlessly, commenting in low tones about how wet and needy a legendary cultivator's holes are, how they clench around his fingers like they're starving for something deeper.</p>
<img src="images/Sex/gate_legend_finger1.webp" class="nsfw-glow">
<p>He keeps this up for what feels like an eternity — three fingers stretching your asshole open while two pump steadily in your cunt, driving you toward an orgasm he seems determined to wring from you. When you finally come it's with your entire body trembling, your inner walls spasming around his invading fingers. He grins wickedly as he withdraws, leaving you gasping and flushed against the table.</p>
<<else>>
<!-- TEASING INSPECTION -->
<p>He orders you to undress, his voice brooking no argument. You comply, letting your robes fall to reveal your body to his hungry gaze. He walks around you slowly, taking in every detail — the curve of your breasts, the flat of your belly, the delicate folds between your thighs.</p>
<p>His hands follow, groping every inch of your body with casual possession. He spreads your legs and slowly slides a finger into your cunt, working in a languid rhythm while his other hand traces patterns across your skin. He whispers how honored he feels to touch such a renowned beauty, how the legends don't do your body justice. His touch is maddening — slow, deliberate, designed to tease rather than satisfy. He brushes against your clit, drawing gasps from you, then pulls away, leaving you aching for more contact.</p>
<img src="images/Sex/gate_legend_tease1.webp" class="nsfw-glow">
<p>He keeps you on the edge of desire for what feels like hours, building you up only to pull back, over and over, until you're pleading with him for release.</p>
<</if>>
<p>When it is over he straightens his armor, flushed and satisfied. <span class="male1">"The seal should lift within days… This one will send word."</span></p>
<<startStatChanges>>
<<gainStat "PCsexFame" "PCsexFame" 5 0 99999 "Sex Fame">>
<<showStatChanges>>
<p>[[Return to the road->Map|Region1]]</p>
<</replace>>
<</link>>
<<link "Remind him exactly who he is speaking to">>
<<replace "#gate-choices">>
<p class="choice-taken">Accept the escort — and what it implies</p>
<p class="choice-taken">Remind him exactly who he is speaking to</p>
<</replace>>
<<replace "#gate-body">>
<p>You let the silence sit for exactly long enough. Then: <span class="player">"Both reputations."</span> You step toward him until he has to choose between holding his ground and stepping back. He steps back. <span class="player">"One of them is going to matter to you significantly more than the other in about ten seconds. I'd think carefully about which one."</span></p>
<p>He thinks carefully. He bows — properly this time, so low his forehead nearly touches the ground.</p>
<p><span class="male1">"A pavilion has been prepared for distinguished guests. Please accept it while we send word inside."</span></p>
<<startStatChanges>>
<<gainStat "PCrighteousreputation" "PCrighteousreputation" 3 0 999 "Righteous Reputation">>
<<showStatChanges>>
<p>[[Return to the road->Map|Region1]]</p>
<</replace>>
<</link>>
</div>
<<else>>
<!-- Original non-NSFW high fame respectful path -->
<p>The guard trails off mid-sentence. The one above leans over the railing. A pause spreads through all three of them — the specific silence of men who have just realized they are talking to someone whose name they have heard in stories.</p>
<p>The gate captain descends the stairs at a controlled pace, clasping both hands and bowing low.</p>
<p><span class="male1">"This one did not know the honored <<print $CurrentPcSectRank>> would be travelling to Phoenix City personally. The seal on these gates is the City Lord's own mark — I have no authority to lift it, even now. This is… deeply regrettable."</span> He sounds like he means it. <span class="male1">"A private pavilion has been prepared in the outer ward for distinguished guests. Please accept it while we send word inside."</span></p>
<div class="choices" id="gate-choices">
<<link "Accept the pavilion with grace">>
<<replace "#gate-choices">>
<p class="choice-taken">Accept the pavilion with grace</p>
<p class="choice-taken">Make clear your displeasure — this delay will be remembered</p>
<</replace>>
<<replace "#gate-body">>
<p><span class="player">"Send word quickly,"</span> you say. <span class="player">"I won't wait long."</span></p>
<p>The captain bows again, visibly relieved. You are escorted to a pavilion outside the walls — lacquered wood, incense burning, tea already steeping. A servant hovers nearby, ready to attend to your needs.</p>
<p>The gate remains sealed. But at least the tea is good, and you have time to contemplate whatever trouble has prompted the City Lord to close their gates.</p>
<<startStatChanges>>
<<gainStat "PCrighteousreputation" "PCrighteousreputation" 3 0 999 "Righteous Reputation">>
<<showStatChanges>>
<p>[[Return to the road->Map|Region1]]</p>
<</replace>>
<</link>>
<<link "Make clear your displeasure — this delay will be remembered">>
<<replace "#gate-choices">>
<p class="choice-taken">Accept the pavilion with grace</p>
<p class="choice-taken">Make clear your displeasure — this delay will be remembered</p>
<</replace>>
<<replace "#gate-body">>
<p>You say nothing immediately. You let the silence do the work. When you finally speak, your voice is quiet and carries the weight of absolute certainty.</p>
<p><span class="player">"The City Lord who sealed this gate will explain the delay to me personally when I enter. See that message reaches them."</span></p>
<p>The captain's face goes a shade paler. He bows so low he nearly doubles over. <span class="male1">"Of course. Of course. At once."</span></p>
<p>You turn and walk back toward the road at your own pace, unhurried and deliberate. Nobody speaks until you are well away, and even then only in hushed, urgent whispers.</p>
<<startStatChanges>>
<<gainStat "PCdemonicreputation" "PCdemonicreputation" 2 0 999 "Demonic Reputation">>
<<showStatChanges>>
<p>[[Return to the road->Map|Region1]]</p>
<</replace>>
<</link>>
</div>
<</if>>
<!-- ══════════════════════════════════
RENOWNED (1001–5800)
══════════════════════════════════ -->
<<elseif $totalFame gte 1001>>
<<if $sexFame gte 100 || random(1,100) lte 45>>
<p>The guard who spoke blinks. His partner leans over and says something low — your name, probably, and something else alongside it that makes the first guard look at you differently than he did a moment ago. Interest. Possibility.</p>
<p>A senior guard emerges from the gatehouse, his eyes taking you in slowly and deliberately. <span class="male1">"The guardhouse is private. I could make it worth your time."</span></p>
<div class="choices" id="gate-choices">
<<link "Step inside — see what 'worth your time' means to a gate guard">>
<<replace "#gate-choices">>
<p class="choice-taken">Step inside — see what 'worth your time' means to a gate guard</p>
<p class="choice-taken">Decline and leave him with nothing</p>
<</replace>>
<<replace "#gate-body">>
<p>You glance at the door, then back at him. <span class="player">"You have ten minutes."</span></p>
<<if _variant is 1>>
<p>He wastes no time. He bends you over the table and slams his thick cock into your cunt, fucking you with powerful strokes that drive the air from your lungs. Your breasts bounce with each impact as he grips your hips, using your body for his pleasure. The table creaks in protest beneath you as he sets a relentless pace, groaning at the feeling of your tight cunt gripping his length.</p>
<p>He continues like this, chasing his own release with single-minded focus, until finally he pulls out and flips you around. He lifts you onto the table and drives back in, forcing your thighs open as he pounds into you face-to-face. You lock eyes with him as he fucks you, watching his expression shift as he approaches climax.</p>
<img src="images/Sex/gate_renowned_fuck1.webp" class="nsfw-glow">
<p>When he feels close he pulls you into his lap, still buried inside you. You straddle him in the chair as he grabs your waist and pulls you down onto his cock, forcing you to ride him while he thrusts upward. The sensation is overwhelming — filled completely, with no room to move except in the direction he pulls you. Within moments he groans and floods your core with thick spurts of cum, holding you down so that every drop fills you completely.</p>
<img src="images/Sex/gate_renowned_fuck2.webp" class="nsfw-glow">
<<elseif _variant is 2>>
<p>He gropes your breasts roughly, squeezing and kneading them as though testing their ripeness. His hands roam down your body and he shoves two thick fingers into your cunt without preamble, working them in and out while he watches your face. He growls filthy praise about how tight you are, how lucky he is to have access to a woman of your power and beauty. His other hand finds your asshole, sliding a finger into that tight entrance as well, stretching both holes simultaneously while you stand there subjected to his rough examination.</p>
<img src="images/Sex/gate_renowned_finger1.webp" class="nsfw-glow">
<p>He works you over with single-minded determination, his fingers pumping in both holes as he mutters about how incredible it is to have you like this, how the stories didn't capture the reality of your body responding to his touch. He pushes deeper, faster, until you're gasping despite yourself.</p>
<<else>>
<p>He teases you with deliberate slowness. His hands roam across your body, mapping every curve as though committing you to memory. He traces his fingers along your neck, your shoulders, down your spine. When he finally moves between your legs he takes his time, exploring the sensitive flesh with maddening gentleness. He spreads your lips and examines you openly, commenting on your beauty while his fingers barely touch your clit, sending shivers through you with the feather-light contact.</p>
<img src="images/Sex/gate_renowned_tease1.webp" class="nsfw-glow">
<</if>>
<<startStatChanges>>
<<gainStat "PCsexFame" "PCsexFame" 4 0 99999 "Sex Fame">>
<<showStatChanges>>
<p>[[Return to the road->Map|Region1]]</p>
<</replace>>
<</link>>
<<link "Decline and leave him with nothing">>
<<replace "#gate-choices">>
<p class="choice-taken">Step inside — see what 'worth your time' means to a gate guard</p>
<p class="choice-taken">Decline and leave him with nothing</p>
<</replace>>
<<replace "#gate-body">>
<p>You look at his hand on the door, then at him. You say nothing. You simply turn and walk away.</p>
<p>The silence you leave behind is the loudest thing that happens to him today. By the time he processes what just happened, you're already back on the road.</p>
<p>[[Return to the road->Map|Region1]]</p>
<</replace>>
<</link>>
</div>
<<else>>
<p>The guard who spoke blinks. His partner leans in and says something low. The first guard straightens immediately, and some of the casual predation drains from his posture.</p>
<p><span class="male1">"Forgive this one."</span> His tone has shifted — still firm, but careful now. <span class="male1">"The <<print $CurrentPcSectRank>>'s reputation is known even here. The seal on these gates carries the City Lord's personal mark — it is beyond this guard's authority to override regardless of who stands before me. No one enters while it holds."</span> He adds, a little stiffly: <span class="male1">"No disrespect intended."</span></p>
<div class="choices" id="gate-choices">
<<link "Ask what the closure is about">>
<<replace "#gate-choices">>
<p class="choice-taken">Ask what the closure is about</p>
<p class="choice-taken">Leave without a word</p>
<</replace>>
<<replace "#gate-body">>
<p>He hesitates, then decides honesty costs him less than evasion with someone like you.</p>
<p><span class="male1">"Internal matter — something within the city that the City Lord wishes contained. Until it is resolved, the seal stands. It should lift within days."</span> A pause. <span class="male1">"Perhaps less, if the matter resolves quickly."</span></p>
<p>Useful information. You file it away for later consideration and turn to leave.</p>
<p>[[Return to the road->Map|Region1]]</p>
<</replace>>
<</link>>
<<link "Leave without a word">>
<<replace "#gate-choices">>
<p class="choice-taken">Ask what the closure is about</p>
<p class="choice-taken">Leave without a word</p>
<</replace>>
<<replace "#gate-body">>
<p>You hold his gaze for a moment — long enough for him to understand you're not angry, just unimpressed — then turn and walk back the way you came. You don't need to say anything. He watches you go and doesn't relax until you've rounded the bend and disappeared from sight.</p>
<<startStatChanges>>
<<gainStat "PCrighteousreputation" "PCrighteousreputation" 1 0 999 "Righteous Reputation">>
<<showStatChanges>>
<p>[[Return to the road->Map|Region1]]</p>
<</replace>>
<</link>>
</div>
<</if>>
<!-- ══════════════════════════════════
KNOWN (551–1000)
══════════════════════════════════ -->
<<elseif $totalFame gte 551>>
<<if $sexFame gte 100>>
<p>Something shifts in the guard's expression — not just recognition of your cultivation rank, but the other kind of recognition. He glances at his partner. Some wordless agreement passes between them.</p>
<p><span class="male1">"Gate's sealed,"</span> he says. <span class="male1">"City Lord's order."</span> But he hasn't stepped back. <span class="male1">"Cultivator travelling alone, no entry documentation — standard procedure is to hold you for questioning."</span> He tilts his head toward the guardhouse. <span class="male1">"Shouldn't take long. Depends on how cooperative you are."</span></p>
<div class="choices" id="gate-choices">
<<link "Go with them — cooperation has its uses">>
<<replace "#gate-choices">>
<p class="choice-taken">Go with them — cooperation has its uses</p>
<p class="choice-taken">Remind them that 'known' cuts both ways</p>
<p class="choice-taken">Acknowledge the order and leave cleanly</p>
<</replace>>
<<replace "#gate-body">>
<<if _variant is 1>>
<p>Both guards use your mouth and cunt eagerly, treating you like a dual cultivation furnace. The first one sits on the edge of the table and pulls you to your knees, forcing his cock into your mouth while the second enters you from behind, filling your cunt with deep, powerful strokes. You gag as the first one fucks your throat while the second pounds into your wetness, the double penetration sending waves of sensation through your body. When the first one comes he floods your mouth with cum, and you swallow every drop before he withdraws and the second one pulls you onto the table, finishing inside you with a satisfied groan.</p>
<img src="images/Sex/gate_known_fuck1.webp" class="nsfw-glow">
<img src="images/Sex/gate_known_fuck2.webp" class="nsfw-glow">
<<elseif _variant is 2>>
<p>They aggressively finger your cunt and ass while groping your body. One holds you against the wall while the other kneels before you, his fingers plunging into both your holes simultaneously as you stand trapped between them, subject to their rough attentions. Your breasts are squeezed and kneaded, your ass is slapped, your holes are stretched and violated until you're trembling between them.</p>
<img src="images/Sex/gate_known_finger1.webp" class="nsfw-glow">
<<else>>
<p>They take their time examining you, running their hands over every inch of your body as you stand in the center of the guardhouse. They appreciate you like a work of art, commenting on your beauty while their hands grow increasingly bold.</p>
<img src="images/Sex/gate_known_tease1.webp" class="nsfw-glow">
<</if>>
<<startStatChanges>>
<<gainStat "PCsexFame" "PCsexFame" 3 0 99999 "Sex Fame">>
<<showStatChanges>>
<p>[[Return to the road->Map|Region1]]</p>
<</replace>>
<</link>>
<<link "Remind them that 'known' cuts both ways">>
<<replace "#gate-choices">>
<p class="choice-taken">Go with them — cooperation has its uses</p>
<p class="choice-taken">Remind them that 'known' cuts both ways</p>
<p class="choice-taken">Acknowledge the order and leave cleanly</p>
<</replace>>
<<replace "#gate-body">>
<p><span class="player">"You know my name,"</span> you say evenly. <span class="player">"That means people will know yours, if I choose to share it. Think about whether 'questioned a known cultivator without cause' is a story you want told about you."</span></p>
<p>The first guard closes his mouth. The second one looks at the road. The implications of your words settle over them like a shadow.</p>
<p>You walk past them without waiting for an answer, and neither of them attempts to stop you.</p>
<<startStatChanges>>
<<gainStat "PCrighteousreputation" "PCrighteousreputation" 2 0 999 "Righteous Reputation">>
<<showStatChanges>>
<p>[[Return to the road->Map|Region1]]</p>
<</replace>>
<</link>>
<<link "Acknowledge the order and leave cleanly">>
<<replace "#gate-choices">>
<p class="choice-taken">Go with them — cooperation has its uses</p>
<p class="choice-taken">Remind them that 'known' cuts both ways</p>
<p class="choice-taken">Acknowledge the order and leave cleanly</p>
<</replace>>
<<replace "#gate-body">>
<p><span class="player">"Days? Weeks?"</span></p>
<p>He blinks — he was expecting a different response. <span class="male1">"Days. Probably."</span></p>
<p><span class="player">"Good."</span> You turn and go. Behind you, you hear one of them exhale in relief.</p>
<p>[[Return to the road->Map|Region1]]</p>
<</replace>>
<</link>>
</div>
<<else>>
<p>Something shifts in the guard's expression as he looks at you more carefully. He doesn't bow. But the dismissiveness drains out of his posture.</p>
<p><span class="male1">"You're— "</span> He stops himself. Looks at his partner. Back at you. <span class="male1">"The gate is sealed under the City Lord's direct order. No entry, not for anyone. That includes cultivators of reputation."</span> He adds, a little stiffly: <span class="male1">"No disrespect intended."</span></p>
<div class="choices" id="gate-choices">
<<link "Acknowledge it — ask if there's a timeline">>
<<replace "#gate-choices">>
<p class="choice-taken">Acknowledge it — ask if there's a timeline</p>
<p class="choice-taken">Attempt to push past on cultivation authority alone</p>
<</replace>>
<<replace "#gate-body">>
<p><span class="player">"Days? Weeks?"</span></p>
<p>He relaxes a fraction. <span class="male1">"Word inside says days. The matter is being handled."</span></p>
<p><span class="player">"Good."</span> You turn to leave. Behind you, you hear him exhale.</p>
<p>[[Return to the road->Map|Region1]]</p>
<</replace>>
<</link>>
<<link "Attempt to push past on cultivation authority alone">>
<<replace "#gate-choices">>
<p class="choice-taken">Acknowledge it — ask if there's a timeline</p>
<p class="choice-taken">Attempt to push past on cultivation authority alone</p>
<</replace>>
<<replace "#gate-body">>
<p>You step forward. Both guards snap their halberds down — crossed directly in front of you, tips level with your throat. The third leans out of the gatehouse with a hand on a warning bell.</p>
<p><span class="male1">"Don't,"</span> the first guard says quietly. <span class="male1">"The City Lord's seal responds to forced entry. You'd be announcing yourself to whoever is inside before you cleared the arch."</span></p>
<p>A beat. He's not wrong, and you both know it.</p>
<p>You step back. Pushing the City Lord's authority in public is noticed, and not favorably.</p>
<<startStatChanges>>
<<loseStat "PCrighteousreputation" "PCrighteousreputation" 2 0 999 "Righteous Reputation">>
<<showStatChanges>>
<p>[[Return to the road->Map|Region1]]</p>
<</replace>>
<</link>>
</div>
<</if>>
<!-- ══════════════════════════════════
NOTICED (201–550) — sexFame fork
══════════════════════════════════ -->
<<elseif $totalFame gte 201>>
<<if $sexFame gte 100>>
<p>The guard's eyes track over you with open interest before he remembers himself. He glances at his partner. Something passes between them — a look that says they've made a decision.</p>
<p><span class="male1">"Gate's sealed,"</span> he says. But he hasn't looked away. <span class="male1">"City Lord's order — entry permit required regardless. You don't have one."</span> A pause. <span class="male1">"We could… look into the matter. For the right traveler."</span></p>
<p>His partner moves to block the road back. Not threatening yet. Just present.</p>
<div class="choices" id="gate-choices">
<<link "Ask what 'looking into it' means, exactly">>
<<replace "#gate-choices">>
<p class="choice-taken">Ask what 'looking into it' means, exactly</p>
<p class="choice-taken">Offer spirit stones instead</p>
<<if $corruption gte 81>><p class="choice-taken">[Corruption] Flip it — make him uncomfortable instead</p><</if>>
<</replace>>
<<replace "#gate-body">>
<<if _variant is 1>>
<p>They fuck you thoroughly in the guardhouse. One takes your mouth while the other fills your cunt, and they work together with brutal efficiency, not bothering with foreplay or tenderness. You're bent over the desk, sandwiched between them as they use your body for their shared pleasure. When they finish, they don't bother with aftercare — just step back and straighten their armor while you catch your breath.</p>
<img src="images/Sex/gate_noticed_fuck1.webp" class="nsfw-glow">
<<elseif _variant is 2>>
<p>Heavy fingering and groping inspection. They paw at you roughly, their hands invasive and unapologetic. One holds you against the wall while the other fingers both your holes, and they laugh at your reactions, clearly enjoying your discomfort even as arousal builds within you.</p>
<img src="images/Sex/gate_noticed_finger1.webp" class="nsfw-glow">
<<else>>
<p>Teasing inspection of your body. They make you strip and stand before them while they examine you like merchandise, commenting on your assets and what they'd like to do with you.</p>
<img src="images/Sex/gate_noticed_tease1.webp" class="nsfw-glow">
<</if>>
<<startStatChanges>>
<<gainStat "PCsexFame" "PCsexFame" 2 0 99999 "Sex Fame">>
<<showStatChanges>>
<p>[[Return to the road->Map|Region1]]</p>
<</replace>>
<</link>>
<<link "Offer spirit stones instead">>
<<replace "#gate-choices">>
<p class="choice-taken">Ask what 'looking into it' means, exactly</p>
<p class="choice-taken">Offer spirit stones instead</p>
<<if $corruption gte 81>><p class="choice-taken">[Corruption] Flip it — make him uncomfortable instead</p><</if>>
<</replace>>
<<replace "#gate-body">>
<p>You produce a handful of spirit stones and hold them out. He looks at them. Pockets them without hesitation.</p>
<p><span class="male1">"Appreciated."</span> He doesn't move from the gate. <span class="male1">"Entry still requires a permit. The City Lord's seal is still up. Those covered the inconvenience of the conversation."</span></p>
<p>You've paid to be told no.</p>
<<startStatChanges>>
<<loseStat "PCspiritStones" "PCspiritStones" 8 0 999999 "Spirit Stones">>
<<showStatChanges>>
<p>[[Return to the road->Map|Region1]]</p>
<</replace>>
<</link>>
<<if $corruption gte 81>>
<<link "[Corruption] Flip it — make him uncomfortable instead">>
<<replace "#gate-choices">>
<p class="choice-taken">Ask what 'looking into it' means, exactly</p>
<p class="choice-taken">Offer spirit stones instead</p>
<p class="choice-taken">[Corruption] Flip it — make him uncomfortable instead</p>
<</replace>>
<<replace "#gate-body">>
<p>You step closer to him rather than away. His confidence falters as the distance closes, as he realizes you've taken the initiative rather than retreating.</p>
<p><span class="player">"Personal inspection,"</span> you repeat softly, letting your eyes drag down his body and back up to his face. <span class="player">"And if I'm the one doing the inspecting?"</span></p>
<p>He opens his mouth. Closes it. His partner has stopped walking, suddenly unsure of the power dynamics that have shifted in the space of a heartbeat.</p>
<p>You hold the moment just long enough to enjoy it — watching him squirm, seeing the uncertainty in his eyes as he realizes he's made a mistake — then step back and give him a pleasant smile. <span class="player">"Gate's still closed. I know. I'll return when it opens."</span></p>
<p>You walk away at a pace that makes perfectly clear you are leaving because you chose to, not because you were forced to.</p>
<<startStatChanges>>
<<gainStat "PCdemonicreputation" "PCdemonicreputation" 3 0 999 "Demonic Reputation">>
<<showStatChanges>>
<p>[[Return to the road->Map|Region1]]</p>
<</replace>>
<</link>>
<</if>>
</div>
<<else>>
<p>He barely glances at your face. <span class="male1">"No entry permit, gate's sealed under City Lord's order. Move along."</span></p>
<p>The second guard has already looked away. You are, to them, a mildly inconvenient stranger.</p>
<div class="choices" id="gate-choices">
<<link "Press him on the timeline">>
<<replace "#gate-choices">>
<p class="choice-taken">Press him on the timeline</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#gate-body">>
<p>He shrugs. <span class="male1">"Days, maybe. Not my problem to know."</span> He nods back toward the road. <span class="male1">"Move along."</span></p>
<p>[[Return to the road->Map|Region1]]</p>
<</replace>>
<</link>>
<<link "Leave">>
<<replace "#gate-choices">>
<p class="choice-taken">Press him on the timeline</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#gate-body">>
<p>Not worth the breath. You turn and go without another word.</p>
<p>[[Return to the road->Map|Region1]]</p>
<</replace>>
<</link>>
</div>
<</if>>
<!-- ══════════════════════════════════
UNKNOWN (0–200) — main NSFW gate
══════════════════════════════════ -->
<<else>>
<<if $sexFame gte 100>>
<p>The guard says his piece about the sealed gate — City Lord's order, no entry, no exceptions. But he's looking at you the way men look at something they've decided is theirs to assess. His partner drifts over from the gatehouse. Unhurried. Deliberate.</p>
<p><span class="male1">"Funny thing,"</span> the first one says. <span class="male1">"Unregistered traveler, no documentation, no verified token. Regulations say we hold you for processing."</span> He tilts his head. <span class="male1">"Could take a while."</span></p>
<p>The gatehouse door is open. The road behind you is empty.</p>
<div class="choices" id="gate-choices">
<<if $corruption gte 81>>
<<link "[Corruption] Walk into the gatehouse yourself — let them think it was their idea">>
<<replace "#gate-choices">>
<<if $corruption gte 81>><p class="choice-taken">[Corruption] Walk into the gatehouse yourself — let them think it was their idea</p><</if>>
<p class="choice-taken">Submit to 'processing' — it's not worth a fight over</p>
<p class="choice-taken">Refuse — walk away before this becomes something harder to leave</p>
<p class="choice-taken">Threaten them — remind them what happens to guards who overstep</p>
<</replace>>
<<replace "#gate-body">>
<p>You glance at the open door, then back at him. You walk past him into the gatehouse without a word, forcing him to make a choice: follow or lose control of the situation.</p>
<p>He follows quickly, suddenly less sure who is leading this. His partner closes the door behind them both.</p>
<p>The first one reaches for you and you let him — for about three seconds, until you have his wrist and have made it clear in a very quiet way that you are the one deciding how this goes. The pressure you apply is enough to make his hand shake, enough to let him know that resistance would be very painful. He gets the message. They both do. What follows is thorough and unhurried and entirely on your terms. You take control completely, bending them to your will, using their bodies for your pleasure while they struggle to comprehend how the power dynamic has inverted so completely. By the end they are the ones pinned against the wall while you dress yourself slowly and deliberately.</p>
<p>You leave them there, shaken and confused. The gate is still sealed. You walk back to the road and don't look back.</p>
<<startStatChanges>>
<<gainStat "PCdemonicreputation" "PCdemonicreputation" 3 0 999 "Demonic Reputation">>
<<gainStat "PCcorruption" "PCcorruption" 2 0 99999 "Corruption">>
<<showStatChanges>>
<p>[[Return to the road->Map|Region1]]</p>
<</replace>>
<</link>>
<</if>>
<<link "Submit to 'processing' — it's not worth a fight over">>
<<replace "#gate-choices">>
<<if $corruption gte 81>><p class="choice-taken">[Corruption] Walk into the gatehouse yourself — let them think it was their idea</p><</if>>
<p class="choice-taken">Submit to 'processing' — it's not worth a fight over</p>
<p class="choice-taken">Refuse — walk away before this becomes something harder to leave</p>
<p class="choice-taken">Threaten them — remind them what happens to guards who overstep</p>
<</replace>>
<<replace "#gate-body">>
<<if _variant is 1>>
<p>They use you hard, pounding your holes and filling you with cum. One forces his cock into your cunt while the other takes your ass, and they set a brutal pace that leaves you gasping. They don't concern themselves with your pleasure — this is about their satisfaction, their use of your body as a tool for their release. When they finish they simply dispose of you with casual disregard, wiping themselves off while you're still shaking on the floor.</p>
<img src="images/Sex/gate_low_fuck1.webp" class="nsfw-glow">
<img src="images/Sex/gate_low_fuck2.webp" class="nsfw-glow">
<<elseif _variant is 2>>
<p>Rough double fingering and groping. They hold you down and finger both your holes at the same time, their callused fingers rough and unapologetic as they stretch you open. They work you like they're trying to break something, commenting on how loose or tight your holes are, laughing at your attempts to control your responses.</p>
<img src="images/Sex/gate_low_finger1.webp" class="nsfw-glow">
<<else>>
<p>Rough teasing inspection. They make you strip while they watch, their eyes predatory as they examine every inch of you. Their hands roam across your body, touching where they please, treating you like property to be appraised.</p>
<img src="images/Sex/gate_low_tease1.webp" class="nsfw-glow">
<</if>>
<<startStatChanges>>
<<gainStat "PCsexFame" "PCsexFame" 2 0 99999 "Sex Fame">>
<<showStatChanges>>
<p>[[Return to the road->Map|Region1]]</p>
<</replace>>
<</link>>
<<link "Refuse — walk away before this becomes something harder to leave">>
<<replace "#gate-choices">>
<<if $corruption gte 81>><p class="choice-taken">[Corruption] Walk into the gatehouse yourself — let them think it was their idea</p><</if>>
<p class="choice-taken">Submit to 'processing' — it's not worth a fight over</p>
<p class="choice-taken">Refuse — walk away before this becomes something harder to leave</p>
<p class="choice-taken">Threaten them — remind them what happens to guards who overstep</p>
<</replace>>
<<replace "#gate-body">>
<p>You read the situation and you walk. Not fast — fast looks like fear. Measured. Deliberate. The guard calls something after you. You don't turn around.</p>
<p>The gate is behind you. Still sealed. Still not yours to enter.</p>
<p>[[Return to the road->Map|Region1]]</p>
<</replace>>
<</link>>
<<link "Threaten them — remind them what happens to guards who overstep">>
<<replace "#gate-choices">>
<<if $corruption gte 81>><p class="choice-taken">[Corruption] Walk into the gatehouse yourself — let them think it was their idea</p><</if>>
<p class="choice-taken">Submit to 'processing' — it's not worth a fight over</p>
<p class="choice-taken">Refuse — walk away before this becomes something harder to leave</p>
<p class="choice-taken">Threaten them — remind them what happens to guards who overstep</p>
<</replace>>
<<replace "#gate-body">>
<p><span class="player">"I will remember your faces,"</span> you say quietly. <span class="player">"And the date. And the hour. And every word you said to me."</span> You let that land. <span class="player">"You may want to remember mine."</span></p>
<p>The first guard's smile falters. The second one has gone very still.</p>
<p>You turn and walk away. They don't call after you. They don't move. They just watch you go, suddenly understanding they've made a terrible mistake.</p>
<<startStatChanges>>
<<gainStat "PCrighteousreputation" "PCrighteousreputation" 2 0 999 "Righteous Reputation">>
<<showStatChanges>>
<p>[[Return to the road->Map|Region1]]</p>
<</replace>>
<</link>>
</div>
<<else>>
<!-- NEW RANDOMIZED NSFW CHANCE FOR "NOBODIES" -->
<<set _harassChance to random(1, 100)>>
<<if _harassChance lte 40>>
<p>He looks you up and down. You aren't known here, but the boredom of a long shift seems to be catching up with him. He glances at his partner, some quiet agreement passing between them.</p>
<p><span class="male1">"Gate's sealed,"</span> he says, his tone shifting from dismissive to something a bit more predatory. <span class="male1">"But unregistered travelers still need to be... thoroughly checked for contraband. Standard procedure."</span></p>
<p>He gestures vaguely toward the open door of the guardhouse. <span class="male1">"You can come inside for processing, or you can turn around. Up to you."</span></p>
<div class="choices" id="gate-choices">
<<link "Submit to 'processing' — it's not worth a fight over">>
<<replace "#gate-choices">>
<p class="choice-taken">Submit to 'processing' — it's not worth a fight over</p>
<p class="choice-taken">Turn around and leave</p>
<</replace>>
<<replace "#gate-body">>
<<if _variant is 1>>
<p>They use you hard, pounding your holes and filling you with cum. One forces his cock into your cunt while the other takes your ass, and they set a brutal pace that leaves you gasping. They don't concern themselves with your pleasure — this is about their satisfaction, their use of your body as a tool for their release. When they finish they simply dispose of you with casual disregard, wiping themselves off while you're still shaking on the floor.</p>
<img src="images/Sex/gate_low_fuck1.webp" class="nsfw-glow">
<img src="images/Sex/gate_low_fuck2.webp" class="nsfw-glow">
<<elseif _variant is 2>>
<p>Rough double fingering and groping. They hold you down and finger both your holes at the same time, their callused fingers rough and unapologetic as they stretch you open. They work you like they're trying to break something, commenting on how loose or tight your holes are, laughing at your attempts to control your responses.</p>
<img src="images/Sex/gate_low_finger1.webp" class="nsfw-glow">
<<else>>
<p>Rough teasing inspection. They make you strip while they watch, their eyes predatory as they examine every inch of you. Their hands roam across your body, touching where they please, treating you like property to be appraised.</p>
<img src="images/Sex/gate_low_tease1.webp" class="nsfw-glow">
<</if>>
<<startStatChanges>>
<<gainStat "PCsexFame" "PCsexFame" 2 0 99999 "Sex Fame">>
<<showStatChanges>>
<p>[[Return to the road->Map|Region1]]</p>
<</replace>>
<</link>>
<<link "Turn around and leave">>
<<replace "#gate-choices">>
<p class="choice-taken">Submit to 'processing' — it's not worth a fight over</p>
<p class="choice-taken">Turn around and leave</p>
<</replace>>
<<replace "#gate-body">>
<p>You don't have the time or patience to humor bored gatekeepers with predatory intentions. You turn on your heel and start walking.</p>
<p><span class="male1">"Suit yourself!"</span> one of them calls out, sounding mildly disappointed.</p>
<p>[[Return to the road->Map|Region1]]</p>
<</replace>>
<</link>>
</div>
<<else>>
<!-- Standard non-NSFW rejection for low fame / bad RNG -->
<p><span class="male1">"Gate's sealed. City Lord's order — no entry permit, no entry."</span> He waves a hand at the road. <span class="male1">"Move on."</span></p>
<p>He's already looking past you. You are not a person of interest. You are a minor interruption to a dull afternoon.</p>
<div class="choices" id="gate-choices">
<<link "Ask about getting a permit">>
<<replace "#gate-choices">>
<p class="choice-taken">Ask about getting a permit</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#gate-body">>
<p><span class="male1">"Applications suspended while the City Lord's seal holds. Come back when it opens."</span> He points at the road again. <span class="male1">"Move on."</span></p>
<p>[[Return to the road->Map|Region1]]</p>
<</replace>>
<</link>>
<<link "Leave">>
<<replace "#gate-choices">>
<p class="choice-taken">Ask about getting a permit</p>
<p class="choice-taken">Leave</p>
<</replace>>
<<replace "#gate-body">>
<p>There's nothing here for you yet. You turn and go.</p>
<p>[[Return to the road->Map|Region1]]</p>
<</replace>>
<</link>>
</div>
<</if>>
<</if>>
<</if>>
<span id="gate-body"></span>
<</widget>><<widget "MerchantTroupeWidget">>
<!-- ─────────────────────── pe 0 · Merchant Encounter ─────────────────────── -->
<<if $pe eq 0>>
<<nobr>>
/* ── Cache guard: skip re-roll if returning from a sub-view ── */
<<if $merchantReactionCached is undefined>>
<<set _fames to [
{type:"righteous", val:$totalPCrighteousreputation, min:40},
{type:"demonic", val:$totalPCdemonicreputation, min:40},
{type:"sex", val:$sexFame, min:25},
{type:"general", val:$totalFame, min:0 },
]>>
<<set _eligible to _fames.filter(function(f){ return f.val >= f.min; })>>
<<set _eligible to _eligible.sort(function(a,b){ return b.val - a.val; })>>
<<set _top1 to _eligible.length > 0 ? _eligible[0] : {type:"none",val:0}>>
<<set _top2 to _eligible.length > 1 ? _eligible[1] : {type:"none",val:0}>>
<<set _primary to _top1.val > 0 ? _top1.type : "none">>
<<set _secondary to _top2.val > 0 ? _top2.type : "none">>
<<set _merchantsReaction to "normal">>
<<switch _primary>>
<<case "righteous">> <<set _merchantsReaction to "reverent">>
<<case "demonic">> <<set _merchantsReaction to "fearful">>
<<case "sex">> <<set _merchantsReaction to "lustful">>
<<case "general">> <<set _merchantsReaction to "respectful">>
<</switch>>
/* Cache all randomly-determined values for this encounter */
<<set $merchantReactionCached to _merchantsReaction>>
<<set $merchantSecondaryCached to _secondary>>
<<set $merchantRollCached to random(1,100)>>
<<set $merchantGenderCached to either("son","daughter")>>
<<else>>
/* Restore from cache when returning from shop/rumors */
<<set _merchantsReaction to $merchantReactionCached>>
<<set _secondary to $merchantSecondaryCached>>
<</if>>
/* ════════════════ ARRIVAL FLAVOUR ════════════════ */
<<switch _merchantsReaction>>
<<case "reverent">>
<p>The merchants notice you immediately. Several bow deeply, eyes wide with recognition and respect.</p>
<p><i><<print either("\"An Elder of great virtue!\"", "\"A righteous cultivator walks among us!\"", "\"The heavens have sent a paragon!\"")>></i></p>
<<if _secondary is "sex">>
<p>…yet quite a few gazes linger with poorly concealed hunger. Even paragons, it seems, inspire earthly thoughts.</p>
<<elseif _secondary is "demonic">>
<p>…though an unsettling shadow clings to your aura. They bow regardless. Fear and reverence are not so different in practice.</p>
<<elseif _secondary is "combat">>
<p>The reverence is tinged with healthy wariness of your battle prowess.</p>
<</if>>
<<case "fearful">>
<p>The moment you approach, merchants pale and step back. Whispers spread like spilled oil:</p>
<p><i><<print either("\"It's the Blood Demon!\"", "\"The one who left the valley in corpses!\"", "\"Don't look her in the eye!\"", "\"They say she devoured an elder's golden core whole!\"")>></i></p>
<<if _secondary is "sex">>
<p>Still… some stares betray a dangerous, forbidden attraction. The devil's beauty, they whisper.</p>
<<elseif _secondary is "righteous">>
<p>A few seem torn between terror and inexplicable awe — the righteous thread still in you makes the darkness somehow worse.</p>
<</if>>
<p>One brave — or foolish — merchant steps forward, hands visibly trembling.</p>
<<case "lustful">>
<p>More than a few merchants stare openly, eyes lingering far too long. Smirks and knowing glances pass between them like a shared secret.</p>
<<if _secondary is "demonic">>
<p>The desire is mixed with genuine fear — a very dangerous combination in men like these.</p>
<<elseif _secondary is "combat">>
<p>They lust… but the memory of your reputation keeps their hands exactly where they belong. For now.</p>
<<elseif _secondary is "righteous">>
<p>The hunger mingles with grudging reverence. They want you, and they feel guilty about it, which only makes it worse.</p>
<</if>>
<p>One particularly bold trader approaches with a slow, lazy smile.</p>
<<case "respectful">>
<p>Word of your deeds has reached even these wandering traders. They treat you with cautious respect — slight bows, lowered voices, smiles that reach their eyes.</p>
<<default>>
<p>The merchants greet you with practiced ease — another cultivator, another potential customer. Business is business.</p>
<<if $sexFame gte 30>>
<p>One of the younger apprentices, however, can't stop sneaking glances at you. He flushes scarlet every time your eyes meet.</p>
<</if>>
<</switch>>
/* ════════════════ INTERACTIONS ════════════════ */
<!---------------------------- REVERENT ---------------------------->
<<if _merchantsReaction is "reverent">>
<p><span class="merchant">"Honored cultivator!"</span> the senior merchant calls, bowing until his forehead nearly grazes the dirt. <span class="merchant">"Please — grace our humble caravan. We offer our finest wares, and whatever else might please you."</span></p>
<br><<link "Browse their wares">><<set $pe to 2>><<goto "NormalEvents">><</link>>
<br><<link "Visit the back room">><<set $pe to 4>><<goto "NormalEvents">><</link>>
<br><<link "Ask for rumors and information">><<set $pe to 5>><<goto "NormalEvents">><</link>>
/* ── Blessing request: gender cached, group option at high corruption ── */
<<if $merchantRollCached lte 40>>
<<if $merchantGenderCached is "son">>
<p>The merchant's son steps forward, blushing to his ears. <span class="male1">"Great Immortal… my father humbly asks if you would consider a Dual Cultivation blessing for our family line. A Jade Soul Pill, as dowry. No expectations beyond what you are comfortable with."</span></p>
<<else>>
<p>A young woman emerges from behind the largest wagon — the merchant's daughter, clearly nervous. <span class="female1">"Honored one… my father believes a cultivator of your virtue could strengthen our family's bloodline. Would you consent to a rite of Dual Cultivation? We have prepared a Jade Soul Pill."</span></p>
<</if>>
<<if $corruption gt 20>>
<br><<link "Give the blessing ♡">>
<<set $sexPartner to "the merchant's " + $merchantGenderCached>>
<<set $sexType to "merchant">>
<<set $reason to "blessing">>
<<set $dominance to "neutral">>
<<goto "EncounterInteractionSex">>
<</link>>
<<else>>
<br><i>No… I couldn't do something like that.</i>
<</if>>
<<if $corruption gte 50>>
<p>Several other young merchants edge forward, eyes hopeful. One clears his throat: <span class="male1">"Would the honored one consider… a broader blessing? For the whole family's prosperity?"</span></p>
<br><<link "Bless the whole retinue ♡">>
<<set $sexPartner to "the merchant family">>
<<set $sexType to "merchantgroup">>
<<set $reason to "group blessing">>
<<set $dominance to "dom">>
<<goto "EncounterInteractionSex">>
<</link>>
<</if>>
<</if>>
<br><<link "Continue with your journey" "Map|Region1">>
<<set $pe to 0>>
<<unset $merchantReactionCached $merchantSecondaryCached $merchantRollCached $merchantGenderCached>>
<</link>>
<!---------------------------- FEARFUL ---------------------------->
<<elseif _merchantsReaction is "fearful">>
<p>The senior merchant swallows visibly. <span class="merchant">"W-we have no quarrel with you, exalted one. Please… take whatever you wish. Just… spare us."</span></p>
<div id="choice">
<br><<link "Browse their wares">><<set $pe to 2>><<goto "NormalEvents">><</link>>
<br><<link "Ask for rumors and information">><<set $pe to 5>><<goto "NormalEvents">><</link>>
<br><<linkreplace "Demand tribute">>
<<replace "#choice">>
<<set _angerRoll to random(1,100)>>
<<if _angerRoll lte 30>>
<p>The merchants panic — several draw hidden weapons, courage born of desperation.</p>
<<ScaredMerchants>>
<<BeforeBattle>>
<br><<link "To battle!" "Battle1">>
<<set $passage to "Battle1">>
<<set $nextPe to 10>>
<</link>>
<<else>>
<p><span class="player">"Protection isn't free. Your finest herbs — now — or I consider a different form of payment."</span></p>
<p>They empty their best crates without another word.</p>
<br><<startStatChanges>>
<br><<gainStat "PCdemonicreputation" "PCdemonicreputation" 3 0 999 "Demonic Reputation">>
<br><<showStatChanges>>
<p>You leave with considerably more than expected.</p>
<br><<link "Continue with your journey" "Map|Region1">>
<<set $pe to 0>>
<<unset $merchantReactionCached $merchantSecondaryCached $merchantRollCached $merchantGenderCached>>
<</link>>
<</if>>
<</replace>>
<</linkreplace>>
/* ── Let them appease you: lower bar, they come to you ── */
<<if $corruption gte 25>>
<br><<link "Let them appease you ♡">>
<<set $pe to 2>>
<<set $sexPartner to "the trembling merchant">>
<<set $sexType to "merchant">>
<<set $reason to "appeasement">>
<<set $dominance to "dom">>
<<goto "EncounterInteractionSex">>
<</link>>
<</if>>
/* ── Demand favour: higher bar / dao-imprint gate ── */
<<if $activeDaoImprint.skillid eq "devouringessence" or $corruption gt 40>>
<br><<link "Demand a favour ♡">>
<<set $pe to 2>>
<<set $sexPartner to "merchant">>
<<set $sexType to "merchant">>
<<set $reason to "tribute">>
<<set $dominance to "dom">>
<<goto "EncounterInteractionSex">>
<</link>>
<</if>>
<br><<link "Continue with your journey" "Map|Region1">>
<<set $pe to 0>>
<<unset $merchantReactionCached $merchantSecondaryCached $merchantRollCached $merchantGenderCached>>
<</link>>
</div>
<!---------------------------- LUSTFUL ---------------------------->
<<elseif _merchantsReaction is "lustful">>
<p>The merchant's gaze traces every line of you with barely concealed hunger. <span class="merchant">"Such a jade beauty… a few nights in my carriage and you'll leave with the finest pill in my stock. No one need know, little bird."</span></p>
<div id="choice">
/* ── Full encounter ── */
<<if $corruption gte 30>>
<br><<linkreplace "Accept the 'private transaction' ♡">>
<<replace "#choice">>
<p><span class="player">"A private transaction… I've heard worse proposals. Lead the way."</span></p>
<br><<linkreplace "Seal the arrangement ♡">>
<<replace "#choice">>
<<set $sexCumcount to 0>>
<<set $sexPosition to "">>
<<set $sexFinished to false>>
<<set $scene to 0>>
<<set $pe to 2>>
<div id="casualSexContainer">
<<CasualSex "the bold merchant" "special aphrodisiacs and spirit stones" "neutral" "full" "NormalEvents">>
</div>
<</replace>>
<</linkreplace>>
<</replace>>
<</linkreplace>>
<</if>>
/* ── Tease and deny: no scene, charisma reward ── */
<<if $corruption gte 15>>
<br><<linkreplace "Tease him, then walk away…">>
<<replace "#choice">>
<p>You let a slow smile cross your face and step closer — close enough that his breath catches. You trail a finger along the edge of his display table, hold his gaze exactly one beat too long, and then step away just as his hand twitches forward.</p>
<p><span class="player">"A lovely offer. I'll take your best spirit herb instead."</span></p>
<p>He's too flustered to form an argument. You pocket the herb and leave him standing there, red-faced and speechless.</p>
<br><<startStatChanges>>
<br><<gainStat "sexFame" "sexFame" 3 0 999 "Fame">>
<br><<set $gold to $gold + 20>>
<br><<showStatChanges>>
<br><<link "Continue with your journey" "Map|Region1">>
<<set $pe to 0>>
<<unset $merchantReactionCached $merchantSecondaryCached $merchantRollCached $merchantGenderCached>>
<</link>>
<br><<link "Browse their wares after all">><<set $pe to 2>><<goto "NormalEvents">><</link>>
<</replace>>
<</linkreplace>>
<</if>>
/* ── Name your own terms: dom, fame-gated ── */
<<if $corruption gte 20 and $sexFame gte 30>>
<br><<linkreplace "Name your own terms ♡">>
<<replace "#choice">>
<p>You let him finish his little speech. Then:</p>
<p><span class="player">"You've mistaken the situation, merchant. I'm not one of your customers. If I decide to grace you with my attention, it will be on my terms — and you will be grateful for the privilege."</span></p>
<p>His jaw goes slack. He nods immediately, almost reflexively, and you haven't even told him what the terms are yet.</p>
<<set $sexPartner to "the bold merchant">>
<<set $sexType to "merchant">>
<<set $reason to "dominance">>
<<set $dominance to "dom">>
<<goto "EncounterInteractionSex">>
<</replace>>
<</linkreplace>>
<</if>>
/* ── Decline ── */
<br><<linkreplace "Slap the suggestion away">>
<<replace "#choice">>
<p>You fix him with a look that could freeze a river mid-current.</p>
<p><span class="player">"Keep your filthy thoughts to yourself."</span></p>
<p><span class="merchant">"Of course, of course… forgive my boldness, great immortal."</span> He stumbles backward over his own feet.</p>
<br><<startStatChanges>>
<br><<set $sexFame to Math.max(0, $sexFame - 2)>>
<br><<gainStat "totalFame" "totalFame" 1 0 999 "Reputation">>
<br><<showStatChanges>>
<br><<link "Browse their wares">><<set $pe to 2>><<goto "NormalEvents">><</link>>
<br><<link "Continue with your journey" "Map|Region1">>
<<set $pe to 0>>
<<unset $merchantReactionCached $merchantSecondaryCached $merchantRollCached $merchantGenderCached>>
<</link>>
<</replace>>
<</linkreplace>>
<br><<link "Continue with your journey" "Map|Region1">>
<<set $pe to 0>>
<<unset $merchantReactionCached $merchantSecondaryCached $merchantRollCached $merchantGenderCached>>
<</link>>
</div>
<!---------------------------- RESPECTFUL ---------------------------->
<<elseif _merchantsReaction is "respectful">>
<p><span class="merchant">"A cultivator of renown graces our humble caravan,"</span> the leader says with a genuine bow. <span class="merchant">"Please — allow us to show our appreciation. You will find our prices more flexible for someone of your standing."</span></p>
<br><<link "Browse their wares">><<set $pe to 2>><<goto "NormalEvents">><</link>>
<br><<link "Ask for rumors and information">><<set $pe to 5>><<goto "NormalEvents">><</link>>
/* ── Shy apprentice proposition ── */
<<if $sexFame gte 20 and $corruption gte 20>>
<p>A young apprentice — barely more than a boy, though his qi is not insignificant — edges out from behind a crate, clutching his ledger with both hands.</p>
<p><span class="male1">"Honored… honored cultivator. I know this is deeply improper. But I've heard stories about you, and I — I would consider it the greatest honor of my cultivation if you would… if you might consider…"</span> He trails off, entirely crimson.</p>
<div id="apprentice">
<br><<linkreplace "Hear him out ♡">>
<<replace "#apprentice">>
<p>You tilt your head. He nearly faints.</p>
<<set $sexPartner to "the young apprentice">>
<<set $sexType to "merchant">>
<<set $reason to "honor">>
<<set $dominance to "dom">>
<<goto "EncounterInteractionSex">>
<</replace>>
<</linkreplace>>
<br><<linkreplace "Let him down gently">>
<<replace "#apprentice">>
<p>You give him a look that is not unkind.</p>
<p><span class="player">"Work harder at your cultivation. Come find me in ten years."</span></p>
<p>He looks like he might faint from equal parts shame and hope.</p>
<</replace>>
<</linkreplace>>
</div>
<</if>>
<br><<link "Continue with your journey" "Map|Region1">>
<<set $pe to 0>>
<<unset $merchantReactionCached $merchantSecondaryCached $merchantRollCached $merchantGenderCached>>
<</link>>
<!---------------------------- NORMAL ---------------------------->
<<else>>
<p>The merchants greet you with practiced ease. <span class="merchant">"Welcome, traveler! Pills, talismans, spirit stones, rare ingredients — finest wares from the four directions. What catches your eye?"</span></p>
<br><<link "Browse their wares">><<set $pe to 2>><<goto "NormalEvents">><</link>>
<br><<link "Ask for rumors and information">><<set $pe to 5>><<goto "NormalEvents">><</link>>
/* ── Starstruck young merchant: high sex fame only ── */
<<if $sexFame gte 30 and $corruption gte 20>>
<p>As you look over the nearest display, a younger merchant drifts close under the pretense of rearranging stock. <span class="male1">"You're… you're her, aren't you,"</span> he breathes. Not quite a question. <span class="male1">"The one the stories are about."</span></p>
<div id="youngmerchant">
<br><<linkreplace "\"And what have you heard?\"">>
<<replace "#youngmerchant">>
<p>He swallows hard. <span class="male1">"Enough to know that whatever you charge for your time… I have savings."</span></p>
<br><<linkreplace "Name a price ♡">>
<<replace "#youngmerchant">>
<<set $sexCumcount to 0>>
<<set $sexPosition to "">>
<<set $sexFinished to false>>
<<set $scene to 0>>
<<set $pe to 2>>
<div id="casualSexContainer">
<<CasualSex "the starstruck young merchant" "a handsome sum of spirit stones" "dom" "full" "NormalEvents">>
</div>
<</replace>>
<</linkreplace>>
<br><<linkreplace "Not interested">>
<<replace "#youngmerchant">>
<p>You return your attention to the wares without a word. He retreats to his post and doesn't look up again.</p>
<</replace>>
<</linkreplace>>
<</replace>>
<</linkreplace>>
</div>
<</if>>
<br><<link "Continue with your journey" "Map|Region1">>
<<set $pe to 0>>
<<unset $merchantReactionCached $merchantSecondaryCached $merchantRollCached $merchantGenderCached>>
<</link>>
<</if>>
<</nobr>>
<!-- ─────────────────────── pe 10 · Post-Battle Loot ─────────────────────── -->
<<elseif $pe eq 10>>
<p>You emerge victorious. Some merchants have scattered into the treeline; others lie motionless across the road. You pick through the wreckage methodically before moving on.</p>
<br><<startStatChanges>>
<br><<set $gold += random(10,200)>>
<br><<gainStat "PCdemonicreputation" "PCdemonicreputation" 1 0 999 "Demonic Reputation">>
<br><<showStatChanges>>
<br><<link "Continue with your journey" "Map|Region1">>
<<set $pe to 0>>
<<unset $merchantReactionCached $merchantSecondaryCached $merchantRollCached $merchantGenderCached>>
<</link>>
<!-- ─────────────────────── pe 2 · Browse Wares ─────────────────────── -->
<<elseif $pe eq 2>>
<<set _currentOfferings to $wanderingMerchantInventory.randomMany(4)>>
<div class="merchant-header"><h2>Wandering Merchant</h2></div>
<br><<link "↩ Return to merchant">><<set $pe to 0>><<goto "NormalEvents">><</link>>
<br><<link "Continue with your journey" "Map|Region1">>
<<set $pe to 0>>
<<unset $merchantReactionCached $merchantSecondaryCached $merchantRollCached $merchantGenderCached>>
<</link>>
<p>Your Spirit Stones: <strong><span class="gold-amount"><<print $gold>></span> Spirit Stones</strong></p>
<br><<link "Sell your own items" "NormalEvents">><<set $pe to 3>><</link>>
/* ── Body negotiation entry point ── */
<<if $corruption gte 25>>
<p><i>The merchants keep stealing glances. Perhaps there's another kind of trade to be made…</i></p>
<div id="bodneg">
<br><<linkreplace "💋 Negotiate a better rate…">>
<<replace "#bodneg">>
<p>You catch the lead merchant's eye and hold it exactly one beat too long. His breath stutters audibly.</p>
<p><span class="player">"I think we can come to a more… personal arrangement."</span></p>
<br><<linkreplace "Proceed ♡">>
<<replace "#bodneg">>
<<set $pe to 6>>
<<set $sexCumcount to 0>>
<<set $sexPosition to "">>
<<set $sexFinished to false>>
<<set $scene to 0>>
<div id="casualSexContainer">
<<CasualSex "the lead merchant" "a steep discount on all wares" "neutral" "full" "NormalEvents">>
</div>
<</replace>>
<</linkreplace>>
<br><<linkreplace "Actually, never mind">>
<<replace "#bodneg">>
<p>You think better of it and step back. The merchant exhales quietly, clearly unsure whether to be relieved or disappointed.</p>
<</replace>>
<</linkreplace>>
<</replace>>
<</linkreplace>>
</div>
<</if>>
<<if $purchase neq null>>
<p style="color:#4fc3f7; font-weight:bold; text-align:center;">You have acquired <<print $purchase>>.</p>
<<unset $purchase>>
<<unset $purchaseclass>>
<</if>>
<table class="merchant-table">
<thead>
<tr>
<th>Offer</th>
<th style="width:150px;text-align:center;">Price</th>
<th style="width:100px;text-align:center;">Purchase</th>
</tr>
</thead>
<tbody>
<<for _i to 0; _i lt _currentOfferings.length; _i++>>
<<set _item to _currentOfferings[_i]>>
<tr>
<td>
<div class="item-name"><<print _i+1>>. <<print _item.name>></div>
<div class="item-desc"><<print _item.description>></div>
</td>
<td style="text-align:center;vertical-align:middle;">
<div class="item-price"><<print _item.price>> Spirit Stones</div>
</td>
<td style="text-align:center;vertical-align:middle;">
<<if _item.price gt $gold>>
<span class="not-enough">Not enough</span>
<<else>>
<<capture _item>>
<<link "Buy" "NormalEvents">>
<<set _found to false>>
<<set _index to -1>>
<<for _j to 0; _j lt $playeriteminventory.length; _j++>>
<<if $playeriteminventory[_j].name === _item.name>>
<<set _found to true>>
<<set _index to _j>>
<<break>>
<</if>>
<</for>>
<<if _found>>
<<set $playeriteminventory[_index].quantity += 1>>
<<else>>
<<set _newItem to clone(_item)>>
<<set _newItem.quantity to 1>>
<<set $playeriteminventory.push(_newItem)>>
<</if>>
<<set $gold -= _item.price>>
<<set $purchase to _item.name>>
<<set $purchaseclass to _item.class>>
<<set $pe to 2>>
<</link>>
<</capture>>
<</if>>
</td>
</tr>
<</for>>
</tbody>
</table>
<!-- ─────────────────────── pe 3 · Sell Items ─────────────────────── -->
<<elseif $pe eq 3>>
<div class="merchant-header"><h2>Your Items</h2></div>
<br><<link "↩ Return to merchant">><<set $pe to 0>><<goto "NormalEvents">><</link>>
<br><<link "Continue with your journey" "Map|Region1">>
<<set $pe to 0>>
<<unset $merchantReactionCached $merchantSecondaryCached $merchantRollCached $merchantGenderCached>>
<</link>>
<p>Your Spirit Stones: <strong><span class="gold-amount"><<print $gold>></span> Spirit Stones</strong></p>
<br><<link "Browse the merchants' wares" "NormalEvents">><<set $pe to 2>><</link>>
<<if $purchase neq null>>
<p style="color:#4fc3f7; font-weight:bold; text-align:center;">You have sold <<print $purchase>>.</p>
<<unset $purchase>>
<<unset $purchaseclass>>
<</if>>
<table class="merchant-table">
<thead>
<tr>
<th>Item</th>
<th style="width:150px;text-align:center;">Sell Price</th>
<th style="width:100px;text-align:center;">Sell</th>
</tr>
</thead>
<tbody>
<<set _hasItems to false>>
<<for _i to 0; _i lt $playeriteminventory.length; _i++>>
<<if $playeriteminventory[_i].quantity gt 0>>
<<set _hasItems to true>>
<<capture _i>>
<tr>
<td>
<div class="item-name"><<print _i+1>>. <<print $playeriteminventory[_i].name>></div>
<div class="item-desc"><<print $playeriteminventory[_i].description>></div>
<div class="item-desc">Qty: <<print $playeriteminventory[_i].quantity>></div>
</td>
<td style="text-align:center;vertical-align:middle;">
<div class="item-price"><<print $playeriteminventory[_i].sellprice>> Spirit Stones</div>
</td>
<td style="text-align:center;vertical-align:middle;">
<<link "Sell" "NormalEvents">>
<<set $gold += $playeriteminventory[_i].sellprice>>
<<set $purchase to $playeriteminventory[_i].name>>
<<set $purchaseclass to $playeriteminventory[_i].class>>
<<set $playeriteminventory[_i].quantity -= 1>>
<<set $pe to 3>>
<</link>>
</td>
</tr>
<</capture>>
<</if>>
<</for>>
<<if _hasItems is false>>
<tr>
<td colspan="3" style="text-align:center;"><i>Your satchel is empty.</i></td>
</tr>
<</if>>
</tbody>
</table>
<!-- ─────────────────────── pe 4 · Reverent Back Room ─────────────────────── -->
<<elseif $pe eq 4>>
<p>The senior merchant leads you through a heavy curtain into the private section of the largest wagon. The air smells of aged sandalwood and something faintly charged with spirit energy. Lacquered chests line every wall.</p>
<br><p><span class="merchant">"We don't show these to ordinary travelers,"</span> he murmurs, opening the nearest chest with reverent hands. <span class="merchant">"For someone of your virtue… consider this a gesture of devotion."</span></p>
<<if $purchase neq null>>
<p style="color:#4fc3f7; font-weight:bold; text-align:center;">You have acquired <<print $purchase>>.</p>
<<unset $purchase>>
<<unset $purchaseclass>>
<</if>>
<<nobr>>
<<set _backRoomOfferings to []>>
<<for _raw range $wanderingMerchantInventory.randomMany(2)>>
<<set _disc to clone(_raw)>>
<<set _disc.price to Math.floor(_disc.price * 0.75)>>
<<set _backRoomOfferings.push(_disc)>>
<</for>>
<</nobr>>
<table class="merchant-table">
<thead>
<tr>
<th>Rare Offer</th>
<th style="width:150px;text-align:center;">Price</th>
<th style="width:100px;text-align:center;">Purchase</th>
</tr>
</thead>
<tbody>
<<for _i to 0; _i lt _backRoomOfferings.length; _i++>>
<<set _item to _backRoomOfferings[_i]>>
<tr>
<td>
<div class="item-name"><<print _i+1>>. <<print _item.name>></div>
<div class="item-desc"><<print _item.description>></div>
<div class="item-desc" style="color:#aed581;"><i>Offered at a reverent 25% discount.</i></div>
</td>
<td style="text-align:center;vertical-align:middle;">
<div class="item-price"><<print _item.price>> Spirit Stones</div>
</td>
<td style="text-align:center;vertical-align:middle;">
<<if _item.price gt $gold>>
<span class="not-enough">Not enough</span>
<<else>>
<<capture _item>>
<<link "Buy" "NormalEvents">>
<<set _found to false>>
<<set _index to -1>>
<<for _j to 0; _j lt $playeriteminventory.length; _j++>>
<<if $playeriteminventory[_j].name === _item.name>>
<<set _found to true>>
<<set _index to _j>>
<<break>>
<</if>>
<</for>>
<<if _found>>
<<set $playeriteminventory[_index].quantity += 1>>
<<else>>
<<set _newItem to clone(_item)>>
<<set _newItem.quantity to 1>>
<<set $playeriteminventory.push(_newItem)>>
<</if>>
<<set $gold -= _item.price>>
<<set $purchase to _item.name>>
<<set $purchaseclass to _item.class>>
<<set $pe to 4>>
<</link>>
<</capture>>
<</if>>
</td>
</tr>
<</for>>
</tbody>
</table>
<br><<link "↩ Return to merchant">><<set $pe to 0>><<goto "NormalEvents">><</link>>
<br><<link "Browse the main caravan">><<set $pe to 2>><<goto "NormalEvents">><</link>>
<br><<link "Continue with your journey" "Map|Region1">>
<<set $pe to 0>>
<<unset $merchantReactionCached $merchantSecondaryCached $merchantRollCached $merchantGenderCached>>
<</link>>
<!-- ─────────────────────── pe 5 · Rumors & Information ─────────────────────── -->
<<elseif $pe eq 5>>
<<nobr>>
<<set _rumorPool to []>>
/* ── Base rumors: 2 drawn at random ── */
<<set _baseRumors to [
{tag:"⚔️ Conflict", text:"Two minor sects have been locked in open warfare near Ashbone Ravine for a month. Neither will yield. Neutral parties are strongly advised to take the long route around."},
{tag:"💰 Opportunity", text:"A spirit mine collapsed three days east, trapping low-rank disciples inside. The owning sect is offering open retrieval contracts — generous pay, no questions about methods."},
{tag:"🌿 Cultivation", text:"A wandering elder was spotted near the obsidian cliffs, trading fragments of lost scripture for five-century spirit herbs. Whether the texts are genuine is anyone's guess."},
{tag:"⚠️ Danger", text:"Three cultivators vanished in the mountain passes last month. Their storage rings turned up empty on the roadside. Whatever took them left no tracks, no witness, no body."},
{tag:"🏛️ Politics", text:"The Iron Gate Sect has been quietly purchasing border villages — paying fairly, for now. Locals are distinctly nervous about what comes after 'for now.'"},
{tag:"💰 Trade", text:"Demand for Cold-Sky Lotus has tripled since a plague swept through the northern city. Anyone sitting on stock could name nearly any price right now and find a buyer."},
{tag:"🌿 Resources", text:"Rumor places a small, unregistered spirit spring somewhere in the western hills. No sect has claimed it yet — either it hasn't been verified, or whoever found it is very quietly keeping quiet."},
{tag:"⚠️ Warning", text:"A self-styled toll has appeared on the Eastern Road, enforced by rogue cultivators calling themselves the Iron Vow Brotherhood. They haven't killed anyone yet. The 'yet' is doing a lot of work in that sentence."},
]>>
<<set _shuffled to _baseRumors.sort(function(){ return Math.random()-0.5; })>>
<<set _rumorPool to _rumorPool.concat(_shuffled.slice(0,2))>>
/* ── Fame-gated rumors ── */
<<if $totalPCrighteousreputation gte 40>>
<<set _rumorPool.push(either(
{tag:"🌟 About You", text:"The Jade Virtue Pavilion has been asking after you by name. Something urgent, requiring a cultivator of unimpeachable character — they've been tight-lipped about details, which means it's either dangerous or deeply embarrassing. Possibly both."},
{tag:"🌟 About You", text:"A small orphan sect in the eastern villages has built a roadside shrine with your likeness. The story of your deeds has grown considerably in the telling — apparently you also slew a divine beast and returned a stolen rain cloud."}
))>>
<</if>>
<<if $totalPCdemonicreputation gte 40>>
<<set _rumorPool.push(either(
{tag:"☠️ About You", text:"Three righteous sects have apparently pooled resources to place a bounty on someone matching your description exactly. The sum is significant enough that even some rogue cultivators are taking notice."},
{tag:"☠️ About You", text:"A demon lord in the southern wastes is said to have toasted your name at a banquet, calling you 'the kind of monster that even monsters respect.' Whether that's a compliment depends entirely on your perspective."}
))>>
<</if>>
<<if $sexFame gte 25>>
<<set _rumorPool.push(either(
{tag:"🌸 Whispers", text:"Several prominent young masters have reportedly made significant wagers regarding the possibility of gaining your personal attention. The amounts involved are frankly scandalous. At least two of them can't afford to lose."},
{tag:"🌸 Whispers", text:"Poems about a certain 'jade-faced cultivator of extraordinary gifts' have been circulating at teahouses along the main road. Your name isn't used, but anyone who has met you would recognize the subject immediately."},
{tag:"🌸 Whispers", text:"A pearl-ranked courtesan from the Crimson Lantern House resigned her position this season. Word is she crossed paths with you once and found all subsequent work uninspiring by comparison."}
))>>
<</if>>
<<if $totalFame gte 50>>
<<set _rumorPool.push({tag:"📣 Your Reputation", text:"Your name came up at a regional sect conclave last month. The reaction was divided — half the room went quiet, the other half began talking faster. Neither response is necessarily reassuring."})>>
<</if>>
<<set _displayRumors to _rumorPool.sort(function(){ return Math.random()-0.5; }).slice(0,4)>>
<</nobr>>
<div class="merchant-header"><h2>Rumors & Whispers</h2></div>
<p>The merchants lower their voices and lean in — people who trade in information as readily as goods.</p>
<<for _r range _displayRumors>>
<div class="rumor-card">
<span class="rumor-tag"><<print _r.tag>></span>
<p><<print _r.text>></p>
</div>
<</for>>
<br><<link "↩ Return to merchant">><<set $pe to 0>><<goto "NormalEvents">><</link>>
<br><<link "Browse their wares">><<set $pe to 2>><<goto "NormalEvents">><</link>>
<br><<link "Continue with your journey" "Map|Region1">>
<<set $pe to 0>>
<<unset $merchantReactionCached $merchantSecondaryCached $merchantRollCached $merchantGenderCached>>
<</link>>
<!-- ─────────────────────── pe 6 · Negotiated Shop (40% off) ─────────────────────── -->
<<elseif $pe eq 6>>
<<set _negotiatedOfferings to $wanderingMerchantInventory.randomMany(4)>>
<div class="merchant-header"><h2>A Special Arrangement</h2></div>
<p>The merchant moves through his stock with renewed enthusiasm, pulling out items he'd been reserving for the right buyer. His apprentices have been sent well out of earshot.</p>
<br><p><span class="merchant">"Anything you want — forty percent off. Consider it a privilege to do business with you."</span></p>
<p>Your Spirit Stones: <strong><span class="gold-amount"><<print $gold>></span> Spirit Stones</strong></p>
<<if $purchase neq null>>
<p style="color:#4fc3f7; font-weight:bold; text-align:center;">You have acquired <<print $purchase>>.</p>
<<unset $purchase>>
<<unset $purchaseclass>>
<</if>>
<table class="merchant-table">
<thead>
<tr>
<th>Offer</th>
<th style="width:150px;text-align:center;">Price</th>
<th style="width:100px;text-align:center;">Purchase</th>
</tr>
</thead>
<tbody>
<<for _i to 0; _i lt _negotiatedOfferings.length; _i++>>
<<set _item to clone(_negotiatedOfferings[_i])>>
<<set _item.price to Math.floor(_item.price * 0.6)>>
<tr>
<td>
<div class="item-name"><<print _i+1>>. <<print _item.name>></div>
<div class="item-desc"><<print _item.description>></div>
<div class="item-desc" style="color:#f48fb1;"><i>40% personal discount.</i></div>
</td>
<td style="text-align:center;vertical-align:middle;">
<div class="item-price"><<print _item.price>> Spirit Stones</div>
</td>
<td style="text-align:center;vertical-align:middle;">
<<if _item.price gt $gold>>
<span class="not-enough">Not enough</span>
<<else>>
<<capture _item>>
<<link "Buy" "NormalEvents">>
<<set _found to false>>
<<set _index to -1>>
<<for _j to 0; _j lt $playeriteminventory.length; _j++>>
<<if $playeriteminventory[_j].name === _item.name>>
<<set _found to true>>
<<set _index to _j>>
<<break>>
<</if>>
<</for>>
<<if _found>>
<<set $playeriteminventory[_index].quantity += 1>>
<<else>>
<<set _newItem to clone(_item)>>
<<set _newItem.quantity to 1>>
<<set $playeriteminventory.push(_newItem)>>
<</if>>
<<set $gold -= _item.price>>
<<set $purchase to _item.name>>
<<set $purchaseclass to _item.class>>
<<set $pe to 6>>
<</link>>
<</capture>>
<</if>>
</td>
</tr>
<</for>>
</tbody>
</table>
<br><<link "↩ Return to merchant">><<set $pe to 0>><<goto "NormalEvents">><</link>>
<br><<link "Continue with your journey" "Map|Region1">>
<<set $pe to 0>>
<<unset $merchantReactionCached $merchantSecondaryCached $merchantRollCached $merchantGenderCached>>
<</link>>
<</if>> /* end pe branches */
<</widget>><<widget "MortalRealm">>
<<if $MapRegion eq "Region1">>
<<if $playerX >= 6 && $playerX <= 9 && $playerY >= 6 && $playerY <= 8>> <<set $region to "Hundred Sorrows Mountain">> <p>You ascend the mist-shrouded slopes of <b>Hundred Sorrows Mountain</b>. The air grows heavy with resentment, and each breath tastes like regret. Twisted trees cling to black stone, and the wind carries faint, weeping cries that never seem to stop.</p>
<p>Legends say this place remembers every death that occurred here — and there were many. Vengeful spirits, corrupted beasts, and mad cultivators roam freely, drawn to the sorrowful qi that saturates the soil.</p>
<p>This cursed peak does not forgive mistakes. </p>
<<link "Start exploring" "Hundred Sorrows Mountain">><<set $passage to passage()>>
<<set $region to "Hundred Sorrows Mountain">>
<</link>>
<<elseif $playerX == 2 and $playerY == 12>>
<p>As you crest the final hill, the mist begins to part—revealing the modest yet vibrant town of <b>Jade Creek</b>. Wooden buildings with curved roofs nestle beside a flowing stream, and the faint scent of incense lingers in the air. It may not be a grand city, but it hums with quiet energy and the presence of cultivators.</p>
<<link "Enter town" "Jade Creek Town">>
<<set $region to "Jade Creek Town">>
<</link>>
<<elseif $playerX <= 2 and $playerX >= 1 and $playerY >= 5 and $playerY <= 6>>
<p>Before you stands the <b>Clear Sky Azure Dragon Pavilion</b>. Its high stone walls are etched with ancient calligraphy, and the pavilion’s blue-tiled roofs shimmer faintly under the sunlight, as if resonating with spiritual energy. Disciples in azure robes move with quiet discipline, their presence exuding a calm but formidable aura. This place is both sanctuary and stronghold—a beacon of order in a chaotic world.</p>
<<set $region to "Clear Sky Azure Dragon Pavilion">>
<<link "Enter sect" "ClearSkyAzureDragonPavilion">><</link>>
<<elseif $playerX eq 12 && $playerY eq 8>>
<p>As you approach the far edge of this realm, the world around you shifts. The winds still, the sky dims slightly — and before you stands a shimmering barrier of spiritual force, pulsing faintly like a living thing.</p>
<p>This is the <b>Boundary of Realms</b> — a powerful seal that separates the Lower Realms from what lies beyond: a vast and dangerous world where the true powers reside. It is said that the main branches of the great sects — those with influence stretching across generations — are located past this very barrier.</p>
<p>Beyond it roam cultivators of unimaginable strength, ancient beasts, and lands steeped in primordial energy. The difference in pressure alone makes your qi tremble in your dantian.</p>
<p>A weathered inscription glows softly on a nearby stone: <i>"Only those who have tempered their spirit and transcended the mortal coil may tread the path beyond."</i></p>
<<if $mainStage eq 7 and $readyForRegion2 eq true>>
[[Ascend to higher realm->MainMissionStart]]
<<else>>
<p>For now, the barrier rejects your presence. Your journey in this realm is not yet finished.</p>
<</if>>
<<elseif $playerX >= 0 && $playerX <= 5 && $playerY >= 2 && $playerY <= 3>>
<p>You step into the arid expanse known as <b>Blood Sand Reach</b>. The scorching wind carries the scent of iron, and the sun beats down on dunes stained red — not by mineral, but by centuries of battle.</p>
<p>Whispers tell of rogue cultivators and desert beasts lurking beneath the sands, drawn to the qi of trespassers. This is no place for the unprepared — tread carefully, for death hides in the heat haze.</p><<set $region to "Blood Sand Reach">>
<<link "Start exploring" "Blood Sand Reach">><<set $region to "Blood Sand Reach">><</link>>
<<elseif $playerX >= 8 && $playerX <= 9 && $playerY >= 2 && $playerY <= 3>>
<p>Arriving at <strong>Northern Phoenix City</strong>, you are greeted by the rhythmic bustle of trade, the scent of incense, and the majestic outline of phoenix-shaped architecture glinting under the sky.</p>
<p>This northern stronghold is a center of commerce and cultivation alike — a meeting place of travelers, wandering cultivators, and the influential sects who hold sway in these lands.</p>
<<set $region to "Northern Phoenix City">>
<<link "Enter town" "Northern Phoenix City">>
<<set $region to "Northern Phoenix City">>
<</link>>
<<elseif $playerX eq 3 and $playerY eq 9>>
You stumble upon the Lone Mountain.
Rising in solemn silence, this solitary mountain pierces the clouds — untouched, undisturbed. The wind here carries no whispers, only peace. As you step forward, you feel the weight of countless journeys that led you here.
<<link "Enter" "LonePeak">><</link>>
<<elseif $playerX >= 9 && $playerX <= 10 && $playerY >= 11 && $playerY <= 12>>
<p>You've reached the shadowed grounds of the <strong>Ghost King Netherworld Sect</strong> — a feared branch of an even more powerful sect residing deep within the Upper Realms.</p>
<p>The air here is cold and heavy, despite the lack of wind. Black banners flutter from bone-crafted spires, and pale disciples move silently like ghosts, their eyes empty of compassion.</p>
<<link "Enter sect" "GhostKingNetherworldSect">><</link>>
<<set $region to "Ghost King Netherworld Sect">>
<<elseif $playerX >= 4 && $playerX <= 8 && $playerY >= 4 && $playerY <= 8>>
<p>You find yourself within the vast <b>Great Plains</b>, a seemingly endless stretch of fertile grasslands where gentle winds ripple through fields of emerald green.</p>
<p>Though peaceful at first glance, these plains serve as a crossroads for wandering cultivators, spirit beasts, merchants, and hidden dangers. Ancient battlefields lie buried beneath the soil, and forgotten inheritances occasionally reveal themselves to the fortunate.</p>
<p>The land is rich in spiritual herbs, making it a favored destination for both adventurers and opportunists.</p>
<<set $region to "Great Plains">>
<<link "Start exploring" "Great Plains">><</link>>
<<else>>
<<set $region to "World Map">><<set $npcFinished>>
<</if>>
<</if>>
<</widget>>
<<widget "SecondRealm">>
<<if $playerX eq 0 && $playerY eq 8>>
<p>You reach the place from you've come to higher realms. You can descend to lower realm</p>
<<set $playerX to 12>>
<<set $playerY to 8>>
<<link "Descend to lower realm" "Map|Region1">>
<<set $MapRegion to "Region1">>
<<set $map = [
[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],
[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],
[1,1,1,1,1,1,0,0,0,2,2,0,0,-1],
[1,1,1,1,1,1,0,0,0,2,2,0,0,-1],
[0,0,0,0,0,0,0,0,0,0,0,0,0,-1],
[0,0,0,0,0,0,0,0,0,0,0,0,0,-1],
[0,3,0,0,0,0,0,0,0,0,0,0,0,-1],
[0,0,0,0,0,0,0,0,0,0,0,0,0,-1],
[0,0,0,0,0,0,0,0,0,0,0,0,0,-1],
[0,0,0,0,0,0,0,0,0,0,0,0,0,-1],
[0,0,0,0,0,0,0,0,0,0,0,0,0,-1],
[0,0,0,0,0,0,0,0,0,0,0,0,0,-1],
[0,0,2,0,0,0,0,0,0,0,0,0,0,-1],
[0,0,0,0,0,0,0,0,0,0,0,0,0,-1]
]>>
<</link>>
<</if>>
<</widget>>
<!--=================-
======================
=====================
=========================TOURNAMENT WIDGETS==========-->/* ══════════════════════════════════════════════════════
SPIRIT BEAST SYSTEM
──────────────────────────────────────────────────────
$playerBeasts[] — array of owned beasts
Each beast object is frozen at purchase except:
.stage — grows over time/feeding
.bondLevel — increases through interaction
.statBonus — recalculated on stage change
Bloodline tiers: Common / Uncommon / Rare / Ancient
Growth stages: Hatchling / Juvenile / Adult / Awakened
Personalities: Fierce / Gentle / Cunning / Loyal / Aloof / Playful
Stat bonus formula:
base × bloodlineMultiplier × stageMultiplier
Bloodline: Common ×1 | Uncommon ×1.5 | Rare ×2 | Ancient ×3
Stage: Hatchling ×0.5 | Juvenile ×1 | Adult ×1.5 | Awakened ×2
══════════════════════════════════════════════════════ */
<<widget "GenerateBeast">>
<<silently>>
/* ── Roll rarity ── */
<<set _rarityRoll to random(1, 100)>>
<<if _rarityRoll lte 35>><<set _rarity to "Common">>
<<elseif _rarityRoll lte 60>><<set _rarity to "Uncommon">>
<<elseif _rarityRoll lte 80>><<set _rarity to "Rare">>
<<elseif _rarityRoll lte 90>><<set _rarity to "Special">>
<<elseif _rarityRoll lte 98>><<set _rarity to "Legendary">>
<<else>><<set _rarity to "Mythic">>
<</if>>
<<set _pool to $BeastRarityPools[_rarity]>>
/* ── Roll bloodline from rarity pool ── */
<<set _bloodline to _pool.bloodlines.random()>>
/* ── Derive species ── */
<<set _species to $BeastSpeciesName[_bloodline]>>
/* ── Roll personality ── */
<<set _personality to $BeastPersonalities.random()>>
/* ── Roll starting stage ── */
<<set _stageRoll to random(1, 100)>>
<<if _stageRoll lte 60>><<set _stage to "Infant">>
<<elseif _stageRoll lte 85>><<set _stage to "Young">>
<<else>><<set _stage to "Adult">>
<</if>>
/* ── Build image path from species + stage ── */
/* Species name spaces replaced with underscores */
/* e.g. "Celestial Fox" + "Infant" → images/Beasts/Celestial_Fox_Infant.webp */
<<set _imageSpecies to _species.replace(/\s+/g, "_")>>
<<set _beastImage to "images/Beasts/" + _imageSpecies + "_" + _stage + ".webp">>
/* ── Roll 2–3 traits from rarity trait pool, no duplicates ── */
<<set _traitPool to _pool.traits.slice()>>
<<set _traitCount to _pool.traitCount>>
<<set _rolledTraits to []>>
<<for _t to 0; _t lt _traitCount; _t++>>
<<if _traitPool.length gt 0>>
<<set _pick to _traitPool.random()>>
<<set _rolledTraits.push(_pick)>>
<<set _traitPool.splice(_traitPool.indexOf(_pick), 1)>>
<</if>>
<</for>>
/* ── Stage multiplier ── */
<<set _sm to 0.5>>
<<if _stage eq "Young">><<set _sm to 1>>
<<elseif _stage eq "Adult">><<set _sm to 1.5>>
<<elseif _stage eq "Evolved">><<set _sm to 2>>
<</if>>
/* ── Calculate stat bonus ── */
<<set _baseBonus to $BeastStatBase[_species]>>
<<set _initBonus to {}>>
<<for _k, _v range _baseBonus>>
<<set _initBonus[_k] to Math.floor(_v * _pool.statMult * _sm)>>
<</for>>
/* ── Price ── */
<<set _stagePriceMult to 1>>
<<if _stage eq "Young">><<set _stagePriceMult to 1.3>>
<<elseif _stage eq "Adult">><<set _stagePriceMult to 1.7>>
<</if>>
<<set _finalPrice to Math.floor(_pool.priceBase * _stagePriceMult)>>
/* ── Heat behavior line ── */
<<set _heatLine to $BeastHeatBehavior[_personality]>>
/* ── Build beast object ── */
<<set _newBeast to {
id: Date.now() + random(0, 9999),
species: _species,
bloodline: _bloodline,
rarity: _rarity,
personality: _personality,
stage: _stage,
traits: _rolledTraits,
bondLevel: 0,
inHeat: false,
heatLine: _heatLine,
baseBonus: _baseBonus,
statBonus: _initBonus,
statMult: _pool.statMult,
price: _finalPrice,
beastImage: _beastImage
}>>
<</silently>>
<</widget>>
/* ══════════════════════════════════════════════════════
WIDGET: CalcBeastBonus
Recalculates statBonus after stage change.
Usage: <<CalcBeastBonus _index>>
══════════════════════════════════════════════════════ */
<<widget "CalcBeastBonus">>
<<set _b to $playerBeast[$args[0]]>>
/* Recalc stats */
<<set _sm to 0.5>>
<<if _b.stage eq "Young">><<set _sm to 1>>
<<elseif _b.stage eq "Adult">><<set _sm to 1.5>>
<<elseif _b.stage eq "Evolved">><<set _sm to 2>>
<</if>>
<<set _newBonus to {}>>
<<for _k, _v range _b.baseBonus>>
<<set _newBonus[_k] to Math.floor(_v * _b.statMult * _sm)>>
<</for>>
<<set $playerBeast[$args[0]].statBonus to _newBonus>>
/* Update image path for new stage */
<<set _imageSpecies to _b.species.replace(/\s+/g, "_")>>
<<set $playerBeast[$args[0]].beastImage to "images/Beasts/" + _imageSpecies + "_" + _b.stage + ".webp">>
<</widget>>
/* ══════════════════════════════════════════════════════
BEAST TRADER LINES — context-aware
Usage: <<BeastTraderLine "context">>
Contexts: "general" | "lewd" | "purchase"
══════════════════════════════════════════════════════ */
<<widget "BeastTraderLine">>
<<set _ctx to $args[0] ?? "general">>
<<if _ctx eq "general">>
<<set _lines to [
"\"Bloodline determines ceiling. Personality determines whether you reach it.\"",
"\"Feed them well. Not just spirit herbs — attention. A beast that feels ignored finds ways to be noticed.\"",
"\"The bond forms in the first three nights. After that it's permanent, whether you wanted it to be or not.\"",
"\"Some of these will outlive you. Some of them know it.\"",
"\"A beast at Infant stage bonds deeper than one bought at Adult. The early years shape everything between you.\"",
"\"Traits can conflict with personality. A Bloodthirsty beast with a Skittish personality is the most unpredictable thing I sell. I mention this.\""
]>>
<<elseif _ctx eq "lewd">>
<<set _lines to [
"\"The Fox bloodline runs warm.\" He sets down his ledger. \"Previous owner said it was distracting during meditation. She bought two more.\"",
"\"Spirit beasts sense cultivation energy fluctuations. Every fluctuation. At any hour.\" A pause. \"I tell everyone. Most don't fully understand until the first week.\"",
"\"High bond levels produce... attachment behaviors. The nature of the attachment varies by personality.\" He says this the way someone says something they've had to explain too many times. \"Significantly.\"",
"\"The Wolf bloodline becomes territorial over its owner's scent. If anything else has been near you, it will know, and it will have opinions about this.\"",
"\"Dream-Eating Butterfly. Beautiful creature.\" He closes his ledger. \"It enters your dreams at high bond. Not just to observe. I recommend reading the full care document before deciding.\"",
"\"A beast in heat does not respond to commands. This is in the care document. Most people don't read the care document.\"",
"\"The Fox and the Wolf both develop what I'd call a possessiveness of person at bond level forty and above. I phrase it carefully because the reality is less careful.\""
]>>
<<elseif _ctx eq "purchase">>
<<set _lines to [
"\"She watched the door from the moment it opened this morning. I assumed it was waiting for someone. Apparently it was waiting for you.\"",
"\"He ignored thirty cultivators this week. You're the first he moved toward without being approached.\"",
"\"Good. She was getting restless. A restless spirit beast is everyone in the market's problem.\"",
"\"The bond forms whether you intend it to or not. Just so you know what you're starting.\"",
"\"He'll test your boundaries once. Clearly, in the first week. Set them then, or accept the alternative.\""
]>>
<</if>>
<<= _lines.random()>>
<</widget>><<widget "MainStorylineWidget">>
<!-- Check if the player is standing on the story event tile -->
<<if $storyEvent.active eq true and $playerX eq $storyEvent.x and $playerY eq $storyEvent.y>>
<!-- MISSION 1 (Intro) -->
<<if $storyEvent.stage eq "intro">>
As you move through the dense forest on the map, something unusual catches your eye. A faint glow pulses from behind a cluster of ancient rocks nearby.<br>
<br>
Do you want to investigate?<br>
<<link "Yes" "MainMissionStart">>
<<set $pe to 0>>
<<set $storyEvent.active to false>>
<<set $storyEvent.cooldown to 0>> <!-- Reset cooldown -->
<</link>>
<!-- MISSION 2 (Stage 0) -->
<<elseif $storyEvent.stage eq 0>>
As you wander through the region, you feel strange energy in the air, as if it were calling out to you...<br><br>
Do you want to investigate?<br>
<<link "Yes" "MainMissionStart">>
<<set $pe to 0>>
<<set $storyEvent.active to false>>
<<set $lastStoryAction to $totalTurns>> <!-- Starts the 50-turn countdown -->
<<set $storyEvent.cooldown to 0>> <!-- Reset cooldown -->
<</link>>
<!-- MISSION 3 (Stage 1) -->
<<elseif $storyEvent.stage eq 1>>
<br>While traveling across the map, you encounter a frightened merchant struggling to repair a broken wagon.<br><br>
Do you want to go closer?<br>
<<link "Yes" "MainMissionStart">>
<<set $pe to 0>>
<<set $storyEvent.active to false>>
<<set $lastStoryAction to $totalTurns>>
<<set $storyEvent.cooldown to 0>> <!-- Reset cooldown -->
<</link>>
<!-- MISSION 4 (Stage 1) -->
<<elseif $storyEvent.stage eq 2>>
<br>As you travel along the eastern road, you notice dozens of cultivators moving in the same direction.
<br> Do you want to go closer and see what's happening?<br>
<<link "Yes" "MainMissionStart">>
<<set $pe to 0>>
<<set $storyEvent.active to false>>
<<set $lastStoryAction to $totalTurns>>
<<set $storyEvent.cooldown to 0>> <!-- Reset cooldown -->
<</link>>
<!-- MISSION 4 (Stage 2) -->
<<elseif $storyEvent.stage eq 2.5>>
<br>Register for incoming tournament<br>
<<link "Yes" "MainMissionStart">>
<<set $pe to 0>>
<<set $storyEvent.active to false>>
<<set $lastStoryAction to $totalTurns>>
<<set $storyEvent.cooldown to 0>> <!-- Reset cooldown -->
<</link>>
<!-- MISSION 5 (Stage 1) -->
<<elseif $storyEvent.stage eq 3>>
<br>Take a moment to think about everything?<br>
<<link "Yes" "MainMissionStart">>
<<set $pe to 0>>
<<set $storyEvent.active to false>>
<<set $lastStoryAction to $totalTurns>>
<<set $storyEvent.cooldown to 0>> <!-- Reset cooldown -->
<</link>>
<<elseif $storyEvent.stage eq 4>>
<br>A strange pull tugs at the Phoenix Sigil, like a distant cry from a place that should not exist.<br>
<<link "Follow the resonance" "MainMissionStart">>
<<set $pe to 0>>
<<set $storyEvent.active to false>>
<<set $lastStoryAction to $totalTurns>>
<<set $storyEvent.cooldown to 0>>
<</link>>
<<elseif $storyEvent.stage eq 5>>
<br>Deep beneath the erased sect, a sealed chamber still waits – and its message was meant for you alone.<br>
<<link "Descend to the hidden chamber" "MainMissionStart">>
<<set $pe to 0>>
<<set $storyEvent.active to false>>
<<set $lastStoryAction to $totalTurns>>
<<set $storyEvent.cooldown to 0>>
<</link>>
<<elseif $storyEvent.stage eq 6>>
<br>A familiar, crushing pressure descends from the sky. The Heavenly Inspector has returned.<br>
<<link "Face the Inspector" "MainMissionStart">>
<<set $pe to 0>>
<<set $storyEvent.active to false>>
<<set $lastStoryAction to $totalTurns>>
<<set $storyEvent.cooldown to 0>>
<</link>>
<</if>>
<</if>>
<</widget>><!--__________________________________________________________________________________________
_________________________ Patrol Perimeter Mission__________________________________________________________________________________________
_________________________ -->
<<widget "PatrolPerimeter01">>
<<if $pe eq 0>>
You arrive at the eastern gate just as dusk cloaks the sect in fading twilight. A pair of lanterns sway gently at the entrance, and a small patrol team awaits-swords at their hips, eyes sharp.<br>
<br>
You're assigned to a route along the outer spiritual barrier. It’s quiet… maybe too quiet.
<<CreateNPC001>><<set $juniorNPC to clone(_npc)>>
<<set _roll to random(1,5)>>
<<if _roll gte 2>>
As you near a bend in the forest path, something catches your eye. You notice fresh claw marks gouged into a tree trunk near the barrier. Whatever made them had strength - and didn’t belong near the sect.<br>
<<if _npc.gender eq "female">><span class="female">“Senior Sister… are those demonic beast marks?”</span> the _npc.fullname asks, glancing around nervously.<<else>><span class="male1">“Senior Sister… are those demonic beast marks?”</span> the _npc.fullname asks, glancing around nervously.<</if>><br>
You can choose to:<br>
You kneel and inspect the grooves. They're fresh-no older than a few hours. Blood specks darken the roots nearby.
<div id="choice">
<br><<link "Track the marks deeper into the woods">>
<<replace "#choice">>
You and your partner draw your weapons and begin following the faint trail of blood. The forest grows darker, qi in the air distorted.<br>
<br>
Suddenly, a low growl echoes ahead. A <b>Shadowtail Beast</b> emerges-sleek, dark-furred, its eyes glowing violet.
<<ShadowtailBeast>>
<br><<link "To battle!" "MissionBattle1">><<set $passage to "MissionBattle1">><<set $returnpassage to "MissionWidgets">><<set $pe to 0>><<BeforeBattle>><<set $nextPe to 4>><</link>>
<</replace>>
<</link>>
<br><<link "Return and report">>
<<replace "#choice">>
You mark the tree with a talisman and hurry back to report.<br>
The sect elders nod approvingly.<br>
<span class="male1">“Good instincts. Better to alert us than to act blindly.”</span>
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Set up an ambush">>
<<replace "#choice">>
You and your junior lie in wait near the tree, using a minor qi concealment technique. Hours pass. Finally, the beast returns - sniffing near the blood trail.<br>
With perfect timing, you and the junior leap from the shadows and strike.
<<MissionFinish>>
<</replace>>
<</link>>
</div>
<<elseif $pe eq 1>>
xianxia
<<else>>
One of the junior disciples paired with you is a known flirt. As you patrol the bamboo-lined path,<<if _npc.gender eq "female">>she<<else>>he<</if>> walks a little too close, brushing against your shoulder now and then.<br>
<<if _npc.gender eq "female">><span class="female">“Cold night, isn’t it?” she says, voice low. <span class="female">“We could... keep each other warm while we watch the perimeter. I wouldn’t mind sharing body heat with a senior like you…”</span><<else>><span class="male1">“Cold night, isn’t it?” he says, voice low. <span class="male1">“We could... keep each other warm while we watch the perimeter. I wouldn’t mind sharing body heat with a senior like you…”</span><</if>>
<div id="choice">
<<if $corruption gt 25>><br><<link "Playfully flirt back">>
<<replace "#choice">>
<span class="player">“Only if you’re brave enough to keep up with a senior sister…”</span><br>
He laughs softly, the sound warm and confident.<br>
<span class="male1">“I like my odds. I’m good with my hands, after all-whether sword or… other tools.”</span><br>
You pause beside a tree, half-obscured by tall reeds. The sect is far behind, the perimeter ward humming faintly in the distance. No one else is around.<br>
His hand brushes your waist lightly-waiting for you to stop him. When you don’t, his fingers slide more boldly, slipping beneath the edge of your outer robe.<br>
<span class="male1">“May I?”</span> he whispers.<br>
You lean back against the tree and give him a subtle nod.<br>
He presses close, hands wandering over your body with growing confidence. His palm cups your breast through your robes, thumb flicking your nipple until it hardens beneath the fabric.<br>
<span class="male1">“So soft… Cultivation hasn’t hardened everything, huh?”</span><br>
His body stays close, heat pressing against you as one hand caresses the side of your thigh, slipping higher-so close, yet not quite where you ache. His fingers toy with the edge of your undergarments, knuckles grazing tender flesh without fully touching - close enough to tease, not enough to satisfy.<br>
<span class="male1">“You're already warm here,”</span> he murmurs, lips grazing your ear. <span class="male1">“Is this from the walk… or from me?”</span><br>
His fingertips finally brush your slit, slow and featherlight, just enough to make your hips twitch. He chuckles at your reaction, teasing you through the thin fabric with maddening patience.
<<set _img to ["juniorTease","juniorTease1"].random()>>
<img @src="'images/Sex/' + _img + '.webp'" width=600>
<<if $juniorNPC.internalTrait eq "Wicked" or $juniorNPC.internalTrait eq "Evil">>
He pauses, letting his hand linger just shy of your clit.<br>
<span class="male1">“Mmm. You want it, don’t you?”</span> His voice is almost cruel in its amusement. <span class="male1">“Say it. Beg a little for your junior’s touch.”</span>
<br><<link "Whimper and beg him" $missionpassage>><<set $pe to 1>><</link>>
<br><<link "Smirk and grab his wrist" $missionpassage>><<set $pe to 2>><</link>>
<<else>>
He strokes you again, this time a little firmer, lips brushing your neck as he mutters, <span class="male1">“So sensitive… I wonder how much more you’ll take before you </span><br><<link "lose control." $missionpassage>><<set $pe to 3>><</link>>”
<</if>>
<</replace>>
<</link>><</if>>
<br><<link "Shut him down with icy elegance">>
<<replace "#choice">>
He backs off but watches you all patrol longingly.
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Ignore him">>
<<replace "#choice">>
He keeps up the act but grows more cautious.
<<MissionFinish>>
<</replace>>
<</link>>
</div>
<</if>>
<<elseif $pe eq 1>>
<<PatrolPerimeter01Submissive>>
<<elseif $pe eq 2>>
<<PatrolPerimeter01Dominant>>
<<elseif $pe eq 3>>
<<PatrolPerimeter01Neutral>>
<<elseif $pe eq 4>>
After killing Shadowtail Beast and returning to the sect, you’re commended for your vigilance.
<<set $passage to "Map|Region1">>
<<MissionFinish>>
<</if>>
<</widget>>
<!-- ═══════════════════════════════════════════════════════════════
CLEAN COURTYARD MISSION - EXPANDED
════════════════════════════════════════════════════════════════ -->
<<widget "CleanCourtyard01">>
<<CreateNPC001>>
You arrive at the old courtyard as morning light filters through ancient stone archways. Dust rises in clouds as you begin sweeping, the scent of wet moss clinging to the air.
<<set _chance = random(1,100)>>
<<if $CurrentPcSectRank eq "Initiate">>
You notice another disciple watching from nearby. Their expression shifts based on their nature.
<div id="courtyard-choice">
<<if _npc.internalTrait eq "Kind">>
<<if _npc.gender eq "male">>
<span class="male1">"New here?"</span> he asks warmly. <span class="male1">"If you need help with those weeds, just say so."</span>
<<else>>
<span class="female">"New here?"</span> she asks warmly. <span class="female">"If you need help with those weeds, just say so."</span>
<</if>>
<br><<link "Accept the help gracefully">>
<<replace "#courtyard-choice">>
You work together, and the task becomes pleasant rather than tedious. He shares sect gossip and advice.
<<startStatChanges>>
<br><<gainStat "charisma" "basecharisma" 2 5 40 "Charisma">>
<<gainExp 180>>
<<set $sectFavor += 3>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Insist on doing it yourself">>
<<replace "#courtyard-choice">>
You politely refuse. He shrugs and leaves. The work is harder alone, but you feel proud.
<<startStatChanges>>
<br><<gainStat "willpower" "basewillpower" 1 5 40 "Willpower">>
<br><<gainStat "strength" "basestrength" 1 5 40 "Strength">>
<<gainExp 200>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<<elseif _npc.externalTrait eq "Power-hungry">>
<<if _npc.gender eq "male">>
He scoffs. <span class="male1">"Menial labor suits you. Maybe you'll learn your place."</span>
<<else>>
She scoffs. <span class="female">"Menial labor suits you. Maybe you'll learn your place."</span>
<</if>>
<br><<link "Ignore the insult and work harder">>
<<replace "#courtyard-choice">>
You focus on the task with determination. Let them think what they want.
<<startStatChanges>>
<br><<gainStat "willpower" "basewillpower" 2 5 40 "Willpower">>
<<gainExp 220>>
<<set $sectFavor += 2>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Snap back with wit">>
<<replace "#courtyard-choice">>
<span class="player">"And perhaps you'll learn that arrogance weakens the spirit."</span>
They glare at you but say nothing more. You've made an enemy, but you've earned respect.
<<startStatChanges>>
<br><<gainStat "charisma" "basecharisma" 1 5 40 "Charisma">>
<<gainExp 200>>
<br><<gainStat "corruption" "corruption" 2 0 50 "Corruption">>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<<elseif _npc.externalTrait eq "Romantic" and _chance gte 85>>
<<if _npc.gender eq "male">>
He watches you work, a slight smile on his face. <span class="male1">"You know, sweat suits you. Maybe I'll stick around and watch..."</span>
<<else>>
She watches you work, a slight smile on her face. <span class="female">"You know, sweat suits you. Maybe I'll stick around and watch..."</span>
<</if>>
<br><<link "Play along ">>
<<replace "#courtyard-choice">>
<span class="player">"Keep watching then. Maybe you'll learn something."</span>
They smile, lingering longer than necessary. The attention is flattering.
<<startStatChanges>>
<br><<gainStat "charisma" "basecharisma" 1 5 40 "Charisma">>
<br><<gainStat "corruption" "corruption" 5 0 50 "Corruption">>
<<gainExp 150>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Brush off the comment">>
<<replace "#courtyard-choice">>
You focus on your work, ignoring the flirtation. Efficient and professional.
<<startStatChanges>>
<br><<gainStat "willpower" "basewillpower" 1 5 40 "Willpower">>
<<gainExp 180>>
<<set $sectFavor += 2>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<<else>>
The disciple watches impassively, offering neither help nor insult.
<<startStatChanges>>
<<gainExp 150>>
<<set $sectFavor += 1>>
<<showStatChanges>>
<<MissionFinish>>
<</if>>
</div>
<<elseif $CurrentPcSectRank eq "Core Disciple" or $CurrentPcSectRank eq "True Disciple">>
You arrive to find a junior disciple already struggling with the work. They look up, startled to see a senior helping.
<div id="courtyard-senior-choice">
<<if _npc.internalTrait eq "Selfish">>
<<if _npc.gender eq "male">>
He frowns. <span class="male1">"Senior? Cleaning? Don't you have... people for that?"</span>
<<else>>
She frowns. <span class="female">"Senior? Cleaning? Don't you have... people for that?"</span>
<</if>>
<br><<link "Explain that duty has no rank">>
<<replace "#courtyard-senior-choice">>
<span class="player">"The sect comes before pride. If the courtyard needs cleaning, I clean it."</span>
They seem to absorb this. A lesson in humility.
<<startStatChanges>>
<br><<gainStat "willpower" "basewillpower" 2 5 40 "Willpower">>
<<gainExp 200>>
<<set $sectFavor += 3>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<<elseif _npc.externalTrait eq "Romantic" and _chance gte 88>>
<<if _npc.gender eq "male">>
The disciple watches you for a while, flustered. <span class="male1">"Such elegance, even while sweeping... it makes it hard to focus."</span>
<<else>>
The disciple watches you for a while, flustered. <span class="female">"Such elegance, even while sweeping... it makes it hard to focus."</span>
<</if>>
<br><<link "Flirt back">>
<<replace "#courtyard-senior-choice">>
<span class="player">"Then maybe you should come closer and help. I could use your focus."</span>
They blush deeply but step forward, working alongside you. The tension is delicious.
<<startStatChanges>>
<br><<gainStat "charisma" "basecharisma" 2 5 40 "Charisma">>
<br><<gainStat "corruption" "corruption" 8 0 50 "Corruption">>
<<gainExp 180>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Be kind but professional">>
<<replace "#courtyard-senior-choice">>
<span class="player">"Just focus on the work. We'll be done faster with two of us."</span>
They nod, embarrassed but grateful for the direction.
<<startStatChanges>>
<br><<gainStat "charisma" "basecharisma" 1 5 40 "Charisma">>
<<gainExp 170>>
<<set $sectFavor += 2>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<<elseif _npc.internalTrait eq "Kind">>
<<if _npc.gender eq "male">>
He rushes to help. <span class="male1">"Let me assist, senior! It's the least I can do."</span>
<<else>>
She rushes to help. <span class="female">"Let me assist, senior! It's the least I can do."</span>
<</if>>
<br><<link "Accept and mentor them">>
<<replace "#courtyard-senior-choice">>
You work together, teaching them proper technique. By the time you finish, they've learned something valuable.
<<startStatChanges>>
<br><<gainStat "charisma" "basecharisma" 2 5 40 "Charisma">>
<<gainExp 200>>
<<set $sectFavor += 4>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<<else>>
A junior disciple is struggling with the work. You help them finish efficiently.
<<startStatChanges>>
<<gainExp 150>>
<<set $sectFavor += 2>>
<<showStatChanges>>
<<MissionFinish>>
<</if>>
</div>
<<else>>
<!-- Fallback for any other rank, including "Disciple" and "Inner Disciple" -->
A nearby disciple glances at you while you work but doesn't interfere. You finish your task efficiently.
<<startStatChanges>>
<<gainExp 150>>
<<set $sectFavor += 1>>
<<showStatChanges>>
<<MissionFinish>>
<</if>>
<</widget>>
<!-- ═══════════════════════════════════════════════════════════════
ASSIST ALCHEMY HALL - EXPANDED
═══════════════════════════════════════════════════════════════ -->
<<widget "AssistAlchemy01">>
You enter the Alchemy Hall, where three furnaces blaze with spiritual fire and the air shimmers with alchemical vapors.
The head alchemist, Elder Wu, nods at you. <span class="male1">"Good. We need help grinding herbs and monitoring the second furnace. Don't touch anything without asking first."</span>
<<set _roll to random(1,5)>>
<div id="alchemy-choice">
<<if _roll eq 1>>
<br><<link "Carefully grind the Frost Lotus Root">>
<<replace "#alchemy-choice">>
You work with meticulous precision, grinding the delicate petals into fine powder. Your focus impresses Elder Wu.<br>
<br>
<span class="male1">"Good work. Precision is the soul of alchemy."</span>
<<startStatChanges>>
<br><<gainStat "insight" "baseinsight" 2 5 40 "Insight">>
<br><<gainStat "willpower" "basewillpower" 1 5 40 "Willpower">>
<<gainExp 250>>
<<set $ContributionPoints += 15>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Experiment with the mortar technique">>
<<replace "#alchemy-choice">>
You try an unconventional grinding method that actually works better than expected.<br>
<br>
Elder Wu raises an eyebrow. <span class="male1">"Hm. Unorthodox, but effective. You have instincts for this."</span>
<<startStatChanges>>
<br><<gainStat "insight" "baseinsight" 3 5 40 "Insight">>
<<gainExp 280>>
<<set $ContributionPoints += 20>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<<elseif _roll eq 2>>
<br><<link "Monitor the furnace carefully">>
<<replace "#alchemy-choice">>
You watch the second furnace for hours, adjusting the heat with subtle qi manipulations. The batch completes perfectly.<br>
<br>
<span class="male1">"Excellent control. This batch will yield high-grade pills."</span>
<<startStatChanges>>
<br><<gainStat "insight" "baseinsight" 2 5 40 "Insight">>
<br><<gainStat "spiritualRoot" "basespiritualRoot" 1 10 40 "Spiritual Root">>
<<gainExp 320>>
<<set $ContributionPoints += 20>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Rush the process to finish early">>
<<replace "#alchemy-choice">>
You push the furnace temperature higher to complete the batch faster. It works, but the pills are slightly lower quality.<br>
<br>
Elder Wu frowns. <span class="male1">"Impatience wastes potential. Learn this lesson."</span>
<<startStatChanges>>
<<gainExp 180>>
<<set $ContributionPoints += 8>>
<br><<gainStat "corruption" "corruption" 3 0 50 "Corruption">>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<<elseif _roll eq 3>>
You're mixing reagents when one of the younger apprentices spills a golden tonic down your robe. It clings unpleasantly.<br>
<br>
<span class="male1">"Oh no! I'm so sorry, Senior Sister!"</span>
<br><<link "Forgive them kindly">>
<<replace "#alchemy-choice">>
<span class="player">"Accidents happen. Just be more careful next time."</span><br>
<br>
They're grateful for your patience. Elder Wu notices your kindness.
<<startStatChanges>>
<br><<gainStat "charisma" "basecharisma" 2 5 40 "Charisma">>
<<gainExp 200>>
<<set $ContributionPoints += 15>>
<<set $sectFavor += 2>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Use it as a teaching moment">>
<<replace "#alchemy-choice">>
<span class="player">"Carelessness like this could have ruined a batch worth months of work. Focus."</span><br>
<br>
The apprentice is chastened, but you've made your point about standards.
<<startStatChanges>>
<br><<gainStat "willpower" "basewillpower" 1 5 40 "Willpower">>
<<gainExp 220>>
<<set $ContributionPoints += 18>>
<br><<gainStat "corruption" "corruption" 2 0 50 "Corruption">>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<<elseif _roll eq 4>>
A pinkish cloud rises from spilled aphrodisiac powder—and you inhale it directly before you can stop yourself.<br>
<br>
The scent hits you fast: warm, heady, almost sweet. Heat crawls down your throat and pools low in your belly.<br>
<br>
Your skin prickles, thighs pressing together instinctively. A blush creeps up your face as your breathing grows shallow.
<img src="images/Sex/aphrodisiac.webp" width=600>
Your nipples tighten beneath your robes. You feel wetness gathering between your legs.
<<if $corruption gt 40>>
<br><<link "Excuse yourself and find relief">>
<<replace "#alchemy-choice">>
You stumble out of the hall, claiming you need air. Behind a nearby storage building, you slip your hands beneath your robes, fingers finding your aching sex.<br>
<br>
You work quickly, breath coming in gasps, until release floods through you in waves. Your legs shake as you compose yourself.<br>
<br>
You return to the hall flushed but functional. Elder Wu doesn't comment, though his eyes are knowing.
<<startStatChanges>>
<br><<gainStat "corruption" "corruption" 15 0 50 "Corruption">>
<br><<gainStat "charisma" "basecharisma" 1 5 40 "Charisma">>
<<gainExp 150>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Push through the arousal">>
<<replace "#alchemy-choice">>
You clench your teeth and focus on the work, your body screaming in protest. It's agonizing, but you finish the shift without compromising yourself.<br>
<br>
Elder Wu watches you with new respect. <span class="male1">"Remarkable discipline."</span>
<<startStatChanges>>
<br><<gainStat "willpower" "basewillpower" 3 5 40 "Willpower">>
<<gainExp 300>>
<<set $ContributionPoints += 20>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<<else>>
<br><<link "Push through the arousal">>
<<replace "#alchemy-choice">>
You clench your teeth and focus on the work, your body screaming in protest. It's agonizing, but you finish the shift without compromising yourself.<br>
<br>
Elder Wu watches you with new respect. <span class="male1">"Remarkable discipline."</span>
<<startStatChanges>>
<br><<gainStat "willpower" "basewillpower" 3 5 40 "Willpower">>
<<gainExp 300>>
<<set $ContributionPoints += 20>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<</if>>
<<else>>
<br><<link "Help with herb preparation">>
<<replace "#alchemy-choice">>
You spend the day sorting and preparing ingredients, learning their properties as you work.
<<startStatChanges>>
<br><<gainStat "insight" "baseinsight" 1 5 40 "Insight">>
<<gainExp 200>>
<<set $ContributionPoints += 15>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<</if>>
</div>
<</widget>>
<!-- ═══════════════════════════════════════════════════════════════
DELIVER SUPPLIES - EXPANDED
═══════════════════════════════════════════════════════════════ -->
<<widget "DeliverSupplies01">>
The box on your shoulder is heavy. Bottles of spirit water clink together with every step, and the scent of herbal salve clings to your robes.<br>
<br>
The outer quarters lie far beyond the inner courtyard—humble huts built beneath the shade of ancient trees. Most who live there are injured, overworked, or too weak to progress.
<<set _roll to random(1,100)>>
<div id="deliver-choice">
<<if _roll lte 30>>
As you make your rounds, you find an elderly disciple struggling to move. Their joints are swollen, qi depleted.
<br><<link "Spend extra time helping them">>
<<replace "#deliver-choice">>
You sit with them for an hour, massaging their shoulders and teaching them a breathing technique that helps circulation.<br>
<br>
<span class="oldman">"Bless you, young cultivator. Such kindness is rare here."</span>
<<startStatChanges>>
<br><<gainStat "charisma" "basecharisma" 2 5 40 "Charisma">>
<br><<gainStat "willpower" "basewillpower" 1 5 40 "Willpower">>
<<gainExp 280>>
<<set $sectFavor += 5>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Leave them with the supplies and continue">>
<<replace "#deliver-choice">>
You distribute the supplies quickly and professionally. The elder thanks you, though their eyes seem sad.
<<startStatChanges>>
<<gainExp 200>>
<<set $ContributionPoints += 12>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Suggest they seek the Healing Hall ">>
<<replace "#deliver-choice">>
<span class="player">"Your condition requires proper treatment. Go to the Healing Hall and mention my name."</span><br>
<br>
They nod, hopeful. You complete your rounds efficiently.
<<startStatChanges>>
<<gainExp 220>>
<<set $ContributionPoints += 15>>
<<set $sectFavor += 2>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<<elseif _roll gte 70>>
You encounter a young disciple alone in one of the huts, feverish and delirious. Medicine lies untouched on the table.
<<CreateNPC001>>
<br><<link "Care for them personally ">>
<<replace "#deliver-choice">>
You spend hours tending to them—cooling their forehead with damp cloths, coaxing them to drink medicine, monitoring their breathing.<br>
<br>
By evening, their fever breaks. They look at you with gratitude and something more complex.
<<if _npc.gender eq "female">>
<span class="female">"Thank you... I was so scared..."</span>
<<else>>
<span class="male1">"Thank you... I was so scared..."</span>
<</if>>
<<startStatChanges>>
<br><<gainStat "charisma" "basecharisma" 3 5 40 "Charisma">>
<br><<gainStat "willpower" "basewillpower" 2 5 40 "Willpower">>
<<gainExp 350>>
<<set $sectFavor += 6>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Fetch the Healing Hall disciples to take over">>
<<replace "#deliver-choice">>
You quickly run to fetch proper medical assistance. The trained healers arrive and stabilize the disciple.<br>
<br>
The Healing Master thanks you for the prompt action.
<<startStatChanges>>
<<gainExp 200>>
<<set $ContributionPoints += 10>>
<<set $sectFavor += 3>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<<else>>
You make routine deliveries. Most disciples thank you politely. A few refuse to meet your eyes, ashamed of their status.<br>
<br>
You distribute everything as instructed and return to the sect.
<<startStatChanges>>
<<gainExp 180>>
<<set $ContributionPoints += 12>>
<<showStatChanges>>
<<MissionFinish>>
<</if>>
</div>
<</widget>>
<!-- ═══════════════════════════════════════════════════════════════
TEND BEASTS - EXPANDED WITH TWIST EVENT
═══════════════════════════════════════════════════════════════ -->
<<widget "TendBeasts01">>
You arrive at the Spirit Beast Pens carrying heavy wooden buckets of spirit-infused grain and fresh mountain spring water.
<<set _heatRoll to random(1, 100)>>
<div id="beasts-choice">
<<if _heatRoll <= 30>>
<!-- Beast Heat Twist Event -->
As you approach the enclosure, a massive Crimson-Crested Crane shrieks, its feathers ruffled and eyes glazed with feverish intensity. It's in the middle of its mating cycle!<br>
<br>
The beast aggressively snaps its razor-sharp beak, Yang energy completely out of control.
<br><<link "Use Soothing Lotus incense ">>
<<replace "#beasts-choice">>
You carefully retrieve the rare Soothing Lotus incense from the sect's supplies and begin the proper ritual. The beast gradually calms, its wild energy subsiding.<br>
<br>
You channel your Qi gently, working with the beast's natural rhythm rather than against it.<br>
<br>
The Crane settles, docile once more. You finish cleaning the pen without incident.<br>
<br>
Elder who oversees the beasts watches from afar. <span class="male1">"Excellent technique. Few handle beast heat with such grace."</span>
<<startStatChanges>>
<br><<gainStat "spiritualRoot" "basespiritualRoot" 3 10 40 "Spiritual Root">>
<br><<gainStat "insight" "baseinsight" 2 5 40 "Insight">>
<<gainExp 400>>
<<set $sectFavor += 8>>
<<set $ContributionPoints += 25>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Attempt to sedate it with minimal resources ">>
<<replace "#beasts-choice">>
You try a quicker method using minor sedatives instead of the expensive incense. It partially works, but the beast remains agitated.<br>
<br>
You manage to finish the task, though you get a minor scratch on your arm. The cleanup is messy.
<<startStatChanges>>
<br><<gainStat "strength" "basestrength" 1 5 40 "Strength">>
<<gainExp 280>>
<<set $ContributionPoints += 15>>
<br><<gainStat "corruption" "corruption" 3 0 50 "Corruption">>
<<showStatChanges>>
You should have used proper protocol.
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Attempt to channel its energy into your own cultivation ">>
<<replace "#beasts-choice">>
The beast's Yang energy is intoxicating. You try to absorb some of it, syncing your qi with its mating frenzy.<br>
<br>
For a moment, power floods through you—ecstatic, overwhelming, carnal.
<img src="images/Story/beastcultivation.webp" width=600>
Then the Crane's talons rake across your shoulder, bringing you crashing back to reality.<br>
<br>
You finish the task in pain and shame. The Elder notices your injury but says nothing—yet.
<<startStatChanges>>
<br><<gainStat "corruption" "corruption" 2 0 50 "Corruption">>
<br><<gainStat "spiritualRoot" "basespiritualRoot" 2 10 40 "Spiritual Root">>
<<gainExp 200>>
<<set $health to Math.max(0, $health - 30)>>
<<set $sectSuspicion += 5>>
<<showStatChanges>>
This was unwise. Very unwise.
<<MissionFinish>>
<</replace>>
<</link>>
<<else>>
<!-- Normal Event -->
The Elder's Spirit Cranes are relatively docile today. You spend a peaceful, if slightly smelly, few hours feeding them, sweeping away molted spirit feathers, and scrubbing down the stone floors.
<br><<link "Complete the task with perfect diligence">>
<<replace "#beasts-choice">>
You finish thoroughly and professionally. The pens are spotless, the beasts content.
<<startStatChanges>>
<<gainExp 220>>
<<set $ContributionPoints += 16>>
<<set $sectFavor += 3>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Go through the motions quickly">>
<<replace "#beasts-choice">>
You complete the work adequately, though not with great care. The beasts are fed, the pens passable.
<<startStatChanges>>
<<gainExp 150>>
<<set $ContributionPoints += 10>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<</if>>
</div>
<</widget>>
<!-- ═══════════════════════════════════════════════════════════════
ORGANIZE SCRIPTURE PAVILION - EXPANDED
═══════════════════════════════════════════════════════════════ -->
<<widget "ScripturePavilion01">>
The Scripture Pavilion is perfectly quiet, smelling faintly of old bamboo and spiritual ink. Dust motes dance in the afternoon light filtering through high windows.
<<set _roll to random(1,5)>>
<div id="scripture-choice">
<<if _roll eq 1>>
<br><<link "Organize diligently and study what you find">>
<<replace "#scripture-choice">>
As you sort jade slips, you pause to read passages about cultivation theory. Hours pass in learning.
<<startStatChanges>>
<br><<gainStat "insight" "baseinsight" 3 5 40 "Insight">>
<br><<gainStat "spiritualRoot" "basespiritualRoot" 1 10 40 "Spiritual Root">>
<<gainExp 300>>
<<set $ContributionPoints += 18>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<<elseif _roll eq 2>>
<br><<link "Work quickly to finish early">>
<<replace "#scripture-choice">>
You organize everything efficiently and leave within a few hours. The pavilion keeper appreciates the speed.
<<startStatChanges>>
<<gainExp 180>>
<<set $ContributionPoints += 12>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<<elseif _roll eq 3>>
While organizing, you accidentally activate a damaged jade slip. It projects a flickering illusion of an ancient sword fairy practicing an ethereal stance.
<br><<link "Study the technique carefully">>
<<replace "#scripture-choice">>
You watch the illusion intently, committing the movements to memory. It's beautiful and instructive.
<<startStatChanges>>
<br><<gainStat "martialArts" "basemartialArts" 2 10 40 "Martial Arts">>
<<gainExp 280>>
<<set $ContributionPoints += 15>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Watch it briefly then continue working">>
<<replace "#scripture-choice">>
You enjoy the moment but focus on the task at hand.
<<startStatChanges>>
<<gainExp 200>>
<<set $ContributionPoints += 14>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<<elseif _roll eq 4>>
You notice a hidden compartment behind one of the oldest shelves. Inside is a collection of forbidden scrolls about forbidden dual cultivation techniques.
<br><<link "Report the discovery to the Elders">>
<<replace "#scripture-choice">>
You immediately inform the pavilion keeper and the Sect authorities. They're impressed by your integrity.
<<startStatChanges>>
<br><<gainStat "willpower" "basewillpower" 2 5 40 "Willpower">>
<<gainExp 250>>
<<set $sectFavor += 6>>
<<set $ContributionPoints += 20>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Read them quickly before reporting">>
<<replace "#scripture-choice">>
You flip through the scrolls, absorbing forbidden knowledge before turning them in. Your knowledge is now dangerous.
<<startStatChanges>>
<br><<gainStat "insight" "baseinsight" 2 5 40 "Insight">>
<br><<gainStat "corruption" "corruption" 2 0 50 "Corruption">>
<<gainExp 280>>
<<set $ContributionPoints += 15>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Keep them hidden and study later ">>
<<replace "#scripture-choice">>
You carefully conceal the scrolls, planning to study them in secret. This is direct betrayal of sect trust.
<<startStatChanges>>
<br><<gainStat "corruption" "corruption" 3 0 50 "Corruption">>
<<gainExp 200>>
<<set $sectSuspicion += 3>>
<<showStatChanges>>
You now possess dangerous knowledge, but discovery would be catastrophic.
<<MissionFinish>>
<</replace>>
<</link>>
<<else>>
You spend a peaceful afternoon sorting and dusting. The work is meditative and calm.
<<startStatChanges>>
<br><<gainStat "willpower" "basewillpower" 1 5 40 "Willpower">>
<<gainExp 180>>
<<set $ContributionPoints += 12>>
<<showStatChanges>>
<<MissionFinish>>
<</if>>
</div>
<</widget>>
<!-- ═══════════════════════════════════════════════════════════════
INVESTIGATE DORMITORY DISTURBANCE - EXPANDED
═══════════════════════════════════════════════════════════════ -->
<<widget "DormDisturbance01">>
You patrol the Outer Disciple dormitories late at night, investigating Elder complaints of "strange, rhythmic thumping and suppressed noises."<br>
<br>
Tracing the sound to a secluded storage shed behind the alchemy labs, you peek through a crack in the bamboo wall.<br>
<br>
Inside, illuminated by the soft glow of a night pearl, are a Junior Brother and Junior Sister deeply engaged in unorthodox Yin-Yang dual cultivation, completely ignoring sect curfew!
<<CreateNPC001>>
<<set $targetNPC to clone(_npc)>>
<div id="dorm-choices">
<br><<link "Report them strictly">>
<<replace "#dorm-choices">>
You loudly clear your throat and kick the door open, causing them to shriek and scramble for their scattered robes. You confiscate their identity tokens and officially report them to the Discipline Hall.<br>
<br>
Your strict adherence to sect rules earns the Elder's praise, though the outer disciples will surely curse your name.
<<startStatChanges>>
<br><<gainStat "willpower" "basewillpower" 2 5 40 "Willpower">>
<<gainExp 280>>
<<set $sectFavor += 7>>
<<set $ContributionPoints += 20>>
<br><<gainStat "corruption" "corruption" -5 0 50 "Corruption">>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Blackmail them for resources ">>
<<replace "#dorm-choices">>
You tap a rhythm on the door and demand a "privacy fee" to look the other way. Flustered and terrified of expulsion, they quickly pool together their monthly stipend of spirit stones and slide it under the door.<br>
<br>
You walk away with heavier pockets and a smug smile. No one will know.
<<startStatChanges>>
<br><<gainStat "corruption" "corruption" 4 0 50 "Corruption">>
<<gainExp 200>>
<br><<gainStat "charisma" "basecharisma" 1 5 40 "Charisma">>
<<set $gold += 150>>
<<set $sectSuspicion += 4>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Offer to 'supervise' their cultivation">>
<<replace "#dorm-choices">>
You step inside, calmly locking the door behind you. The two disciples stare in shock.<br>
<br>
<span class="player">"I noticed dangerous flaws in your Qi circulation. As a senior, I should help correct them."</span><br>
<br>
They hesitate, then nod nervously. What follows is an intense, breathless night of "hands-on tutoring."<br>
<br>
You work between them, teaching them to balance Yin and Yang through intimate contact. By dawn, your meridians feel incredibly satisfied, and they're exhausted but grateful.
<img src="images/Sex/dualcultivation.webp" width=600>
<<startStatChanges>>
<br><<gainStat "corruption" "corruption" 4 0 50 "Corruption">>
<br><<gainStat "spiritualRoot" "basespiritualRoot" 2 10 40 "Spiritual Root">>
<br><<gainStat "charisma" "basecharisma" 2 5 40 "Charisma">>
<<gainExp 400>>
<<set $dualCultivationCount += 1>>
<<set $sectSuspicion += 6>>
<<set $arousal to 0>>
<<showStatChanges>>
You return exhausted but power-rich. This secret must be kept carefully.
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Warn them and let them go (Mercy)">>
<<replace "#dorm-choices">>
You knock softly and warn them before the Elder's rounds pass through. They scramble to compose themselves and thank you profusely.<br>
<br>
<span class="female">"Thank you, Senior Sister. We'll be more careful..."</span>
<<startStatChanges>>
<br><<gainStat "charisma" "basecharisma" 2 5 40 "Charisma">>
<<gainExp 220>>
<<set $sectFavor += 2>>
<br><<gainStat "corruption" "corruption" -3 0 50 "Corruption">>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
</div>
<</widget>>
<!-- ═══════════════════════════════════════════════════════════════
JUNIOR DISCIPLE SPARRING - FULLY REVISED VERSION
Combines timed combat system with dynamic rank scaling
═══════════════════════════════════════════════════════════════ -->
<<widget "JuniorSpar01">>
<<if $pe eq 0>>
<<set $sparringRound = 1>>
<<set $playerWins = 0>>
<<set $juniorWins = 0>>
<<CreateNPC001>>
<<set $juniorNPC to clone(_npc)>>
<<set $juniorNPC.friendship to $juniorNPC.friendship || 0>>
<<set $juniorNPC.hadSex to $juniorNPC.hadSex || 0>>
<!-- Set Age and Sect Affiliation -->
<<set $juniorNPC.lifespan to random(18, 24)>>
<<set $juniorNPC.sectNPC to $CurrentPcAffiliation>>
<!-- Dynamically Determine Lower Rank (Max: Disciple) -->
<<set _sectRanks = ["Initiate", "Disciple", "Inner Disciple", "Core Disciple", "True Disciple", "Elder", "Great Elder", "Sect Leader"]>>
<<set _pcRankIndex = _sectRanks.indexOf($CurrentPcSectRank)>>
<<if _pcRankIndex lte 0>>
<<set $juniorNPC.NPCrank to "Initiate">>
<<elseif _pcRankIndex eq 1>>
<<set $juniorNPC.NPCrank to "Initiate">>
<<else>>
<!-- Player is Inner Disciple or higher; Junior can be Initiate or Disciple -->
<<set $juniorNPC.NPCrank to either("Initiate", "Disciple")>>
<</if>>
<!-- Build Junior's Wager Pool Based on Player Corruption -->
<<set _betOptions = ["touch your thigh", "rest a hand on your chest", "feel your ass", "see your panties"]>>
<<if $corruption gt 35>>
<<run _betOptions.push("rub your bare cunt")>>
<<if $juniorNPC.gender eq "male">>
<<run _betOptions.push("get a handjob from you")>>
<<else>>
<<run _betOptions.push("finger your pussy")>>
<</if>>
<</if>>
<<if $corruption gt 65>>
<<if $juniorNPC.gender eq "male">>
<<run _betOptions.push("get a blowjob from you", "fuck your bare pussy")>>
<<else>>
<<run _betOptions.push("have you eat me out", "grind against your bare pussy")>>
<</if>>
<</if>>
<<set _juniorWants = _betOptions.random()>>
<!-- Set Junior's Depravity Based on Their Chosen Wager -->
<<if ["get a blowjob from you", "have you eat me out", "fuck your bare pussy", "grind against your bare pussy"].includes(_juniorWants)>>
<<set $juniorNPC.depravity to random(70, 100)>>
<<elseif ["rub your bare cunt", "get a handjob from you", "finger your pussy"].includes(_juniorWants)>>
<<set $juniorNPC.depravity to random(40, 69)>>
<<elseif ["touch your thigh", "rest a hand on your chest", "feel your ass", "see your panties"].includes(_juniorWants)>>
<<set $juniorNPC.depravity to random(20, 39)>>
<<else>>
<<set $juniorNPC.depravity to random(5, 19)>>
<</if>>
<<set _roll = random(0, 100)>>
<!-- Initial Approach -->
<<if _roll lte 85>>
You enter the courtyard. $juniorNPC.fullname spots you and grins eagerly.<br><br>
<<if $juniorNPC.gender eq "male">>
<span class="male1">"Senior Sister! Let's make this interesting. Want to bet on it?"</span><br><br>
<<else>>
<span class="female">"Senior Sister! Let's make this interesting. Want to bet on it?"</span><br><br>
<</if>>
<span class="player">"What kind of bet did you have in mind?"</span><br><br>
They smirk, clearly testing your boundaries and enjoying the boldness.<br><br>
<<if $juniorNPC.gender eq "male">>
<span class="male1">"How about this – if I win... I get to _juniorWants?"</span><br><br>
<<else>>
<span class="female">"How about this – if I win... I get to _juniorWants?"</span><br><br>
<</if>>
<div id="bet-choice">
<<if $corruption gt 35>>
<<link "Raise the stakes ">>
<<replace "#bet-choice">>
<span class="player">"That's bold. But I counter – if I win..."</span><br><br>
<<set $pe to 1>>
<<link "Continue" $missionpassage>><</link>>
<</replace>>
<</link>><br>
<</if>>
<<if $corruption gt 20>>
<<link "Accept the bet">>
<<replace "#bet-choice">>
<span class="player">"Alright. Let's do it."</span><br><br>
<<set $sparBetStake to _juniorWants>>
<<set $playerBetDemand to "none">>
<<set $pe to 3>>
<<link "Ready yourself..." $missionpassage>><</link>>
<</replace>>
<</link>><br>
<</if>>
<<link "Refuse the wager">>
<<replace "#bet-choice">>
<span class="player">"That's inappropriate. Just a friendly spar."</span><br><br>
<<set $sparBetStake to "none">>
<<set $playerBetDemand to "none">>
<<set $pe to 3>>
<<link "Prepare to spar" $missionpassage>><</link>>
<</replace>>
<</link>>
</div>
<<else>>
<!-- Alternative path - they approach more respectfully -->
You enter the courtyard. $juniorNPC.fullname approaches respectfully.<br><br>
<<if $juniorNPC.gender eq "male">>
<span class="male1">"Senior Sister! Would you spar with me? I'd like to improve."</span><br><br>
<<else>>
<span class="female">"Senior Sister! Would you spar with me? I'd like to improve."</span><br><br>
<</if>>
<div id="spar-choice">
<<link "Accept a friendly bout">>
<<replace "#spar-choice">>
<span class="player">"Of course. Show me what you've learned."</span><br><br>
<<set $sparBetStake to "none">>
<<set $playerBetDemand to "none">>
<<set $pe to 3>>
<<link "Begin sparring" $missionpassage>><</link>>
<</replace>>
<</link>><br>
<<if $corruption gt 25>>
<<link "Suggest a wager">>
<<replace "#spar-choice">>
<span class="player">"How about we make it interesting?"</span><br><br>
<<gainStat "corruption" "corruption" 2 0 50 "Corruption">>
<<set $pe to 1>>
<<goto $missionpassage>>
<</replace>>
<</link>>
<</if>>
</div>
<</if>>
<!-- Integrated logic for $pe eq 1 -->
<<elseif $pe eq 1>>
<div id="pe1-container">
<span class="player">"Alright – but if I win, I want..."</span><br><br>
<!-- Player builds their demand based on corruption -->
<<set _playerOptions = ["100 spirit stones", "250 spirit stones"]>>
<<if $corruption gt 40>>
<<run _playerOptions.push("500 spirit stones", "you to strip shirtless")>>
<</if>>
<<if $corruption gt 75>>
<<if $juniorNPC.gender eq "male">>
<<run _playerOptions.push("to ride your cock")>>
<<else>>
<<run _playerOptions.push("you to eat me out")>>
<</if>>
<</if>>
<div id="raise-choice">
<<for _idx, _opt range _playerOptions>>
<<capture _opt>>
<<link _opt>>
<<replace "#pe1-container">>
<span class="player">"...I want _opt."</span><br><br>
<<set $playerBetDemand to _opt>>
<<set $sparBetStake to _juniorWants>>
<!-- NPC Reaction -->
They whistle softly, eyes widening.<br><br>
<<if $juniorNPC.gender eq "male">>
<span class="male1">"Bold of you, Senior Sister."</span><br><br>
<<else>>
<span class="female">"Bold of you, Senior Sister."</span><br><br>
<</if>>
<!-- Logic for Escalation -->
<<if ($playerBetDemand eq "you to strip shirtless" or $playerBetDemand eq "to ride your cock" or $playerBetDemand eq "you to eat me out") and $juniorNPC.depravity lt 30>>
<<if $juniorNPC.gender eq "male">>
<span class="male1">"That's... that's actually a bit much for me. Let's just stick to sparring."</span><br><br>
<<else>>
<span class="female">"That's... that's actually a bit much for me. Let's just stick to sparring."</span><br><br>
<</if>>
<<set $sparBetStake to "none">>
<<set $playerBetDemand to "none">>
<<set $pe to 3>>
<<link "Begin match" $missionpassage>><</link>>
<<else>>
<<if $juniorNPC.gender eq "male">>
<span class="male1">"You're on. Let's see what you've got."</span><br><br>
<<else>>
<span class="female">"You're on. Let's see what you've got."</span><br><br>
<</if>>
<<set $pe to 3>>
<<link "Begin match" $missionpassage>><</link>>
<</if>>
<</replace>>
<</link>><br>
<</capture>>
<</for>>
</div>
</div>
<!-- Combat Round Start -->
<<elseif $pe eq 3>>
<<set $missionpassage to passage()>>
<div class="sparring-round">
<strong>Round <<print $sparringRound>></strong><br>
<b>You:</b> <<print $playerWins>> || <b>$juniorNPC.fullname:</b> <<print $juniorWins>><br><br>
$juniorNPC.fullname circles you, eyes focused and determined.<br><br>
<<set $juniorMove to either("strike", "block", "feint")>>
<<if $juniorNPC.gender eq "male">>
<span class="male1">He prepares to $juniorMove!</span><br><br>
<<else>>
<span class="female">She prepares to $juniorMove!</span><br><br>
<</if>>
<div id="countdown-timer">
Countdown: <strong><span id="time-left">5</span></strong> seconds!<br><br>
</div>
<div id="action-buttons">
<<link "Strike">>
<<set $playerMove to "strike">>
<<set $pe to 4>>
<<goto $missionpassage>>
<</link>><br>
<<link "Block">>
<<set $playerMove to "block">>
<<set $pe to 4>>
<<goto $missionpassage>>
<</link>><br>
<<link "Feint">>
<<set $playerMove to "feint">>
<<set $pe to 4>>
<<goto $missionpassage>>
<</link>>
</div>
<<silently>>
<<timed 1s>>
<<replace "#time-left">>4<</replace>>
<<next 1s>>
<<replace "#time-left">>3<</replace>>
<<next 1s>>
<<replace "#time-left">>2<</replace>>
<<next 1s>>
<<replace "#time-left">>1<</replace>>
<<next 1s>>
<<set $playerMove to "none">>
<<set $pe to 4>>
<<goto $missionpassage>>
<</timed>>
<</silently>>
</div>
<!-- Resolve Combat Round -->
<<elseif $pe eq 4>>
<<set $missionpassage to passage()>>
<!-- Tie -->
<<if $playerMove eq $juniorMove>>
It's a tie! Neither of you land a clean hit. The tension rises as you circle each other.<br><br>
<<set $sparringRound += 1>>
<<set $pe to 3>>
<<link "Next round...">>
<<goto $missionpassage>>
<</link>>
<!-- Player Wins Round -->
<<elseif ($playerMove eq "strike" and $juniorMove eq "feint") or
($playerMove eq "block" and $juniorMove eq "strike") or
($playerMove eq "feint" and $juniorMove eq "block")>>
<<set _pinchance to random(0, 100)>>
<<if _pinchance lte 15 and $sparringRound gt 1>>
<img src="images/Story/pinfall1.png" class="center" width="600"><br><br>
With a sharp twist, you sweep their leg and send them crashing to the ground... You win this round decisively!<br><br>
<<else>>
You win this round with a decisive strike!<br><br>
<</if>>
<<set $playerWins += 1>>
<<if $playerWins gte 3>>
<<set $pe to 5>>
<<link "Continue..." $missionpassage>><</link>>
<<else>>
<<set $sparringRound += 1>>
<<set $pe to 3>>
<<link "Next round...">>
<<goto $missionpassage>>
<</link>>
<</if>>
<!-- Junior Wins Round -->
<<else>>
<<set _pinchance to random(0, 100)>>
<<if _pinchance lte 15 and $sparringRound gt 1>>
<img src="images/Story/pinfall.png" class="center" width="600"><br><br>
You stumble from their final strike—and before you can recover, they lunge, tackling you...<br><br>
<<else>>
$juniorNPC.fullname wins this round with a swift counter!<br><br>
<</if>>
<<set $juniorWins += 1>>
<<if $juniorWins gte 3>>
<<set $pe to 5>>
<<link "Continue..." $missionpassage>><</link>>
<<else>>
<<set $sparringRound += 1>>
<<set $pe to 3>>
<<link "Next round...">>
<<goto $missionpassage>>
<</link>>
<</if>>
<</if>>
<!-- End of Spar - Player Wins -->
<<elseif $pe eq 5 and $playerWins gte 3>>
You've bested $juniorNPC.fullname decisively. They collapse to their knees, chest heaving.<br><br>
<<if $juniorNPC.gender eq "male">>
<span class="male1">"I... I couldn't match you..."</span><br><br>
<<else>>
<span class="female">"I... I couldn't match you..."</span><br><br>
<</if>>
<<if $playerBetDemand neq "none" and $playerBetDemand neq undefined>>
<div id="victory-choice">
<<link "Claim your winnings">>
<<replace "#victory-choice">>
<span class="player">"A deal is a deal. Pay up."</span><br><br>
<<if $playerBetDemand.includes("spirit stones")>>
With a heavy sigh, they pull a pouch from their robes and hand over the spirit stones.<br><br>
<<if $playerBetDemand eq "100 spirit stones">><<set $money += 100>>
<<elseif $playerBetDemand eq "250 spirit stones">><<set $money += 250>>
<<elseif $playerBetDemand eq "500 spirit stones">><<set $money += 500>>
<</if>>
<strong>Received $playerBetDemand!</strong><br><br>
<<elseif $playerBetDemand eq "you to strip shirtless">>
Blushing furiously, they untie their robes and let them fall to the dirt. You slowly circle them, enjoying the sight of their bare chest heaving with exertion under your hungry gaze.<br><br>
<<if $corruption lt 25>><<set $corruption += 2>><</if>>
<<elseif $playerBetDemand eq "to ride your cock">>
<img src="images/Sex/playerBetRideMale.webp" width="600"><br><br>
He swallows hard, lying back on the dirt as you demand. You pull his robes open, freeing his thick, throbbing cock. Without hesitation, you hike up your own robes, exposing your dripping pussy, and lower yourself fully onto his hard shaft. He groans loudly as you sink all the way down, riding him ruthlessly right there in the courtyard until you milk every drop of hot cum from his balls.<br><br>
<<if $corruption lt 85>><<set $corruption += 5>><</if>>
<<set $juniorNPC.hadSex += 1>>
<<elseif $playerBetDemand eq "you to eat me out">>
<img src="images/Sex/playerBetEatFemale.webp" width="600"><br><br>
You force her onto her knees, parting your legs to expose your soaking wet pussy directly in front of her face. "Lick," you command. She trembles but obeys, burying her face between your thighs. Her tongue eagerly slathers over your swollen clit and slips into your dripping slit, eating you out furiously until your legs shake and you cum hard against her mouth.<br><br>
<<if $corruption lt 85>><<set $corruption += 5>><</if>>
<<set $juniorNPC.hadSex += 1>>
<</if>>
<<startStatChanges>>
<<gainStat "martialArts" "basemartialArts" 1 10 40 "Martial Arts">>
<<gainExp 300>>
<<set $juniorNPC.friendship += 10>>
<<showStatChanges>>
<div id="end-options">
<br><br>
<<link "Add $juniorNPC.fullname to Book of Connections" $passage>>
<<AddNPCWithFamily $juniorNPC>>
<<MissionFinishAuto>>
<</link>><br>
<<link "Depart courtyard" $passage>>
<<MissionFinishAuto>>
<</link>>
</div>
<</replace>>
<</link>>
</div>
<<else>>
<!-- Original Default Victory Choices -->
<div id="victory-choice">
<<link "Offer a hand up graciously">>
<<replace "#victory-choice">>
You extend your hand with a warm smile. They take it, pulling themselves up as respect flickers in their eyes.<br><br>
<<startStatChanges>>
<<gainStat "martialArts" "basemartialArts" 1 10 40 "Martial Arts">>
<<gainExp 250>>
<<set $ContributionPoints += 15>>
<<set $sectFavor += 3>>
<<set $juniorNPC.friendship += 15>>
<<showStatChanges>>
<div id="end-options">
<br><br>
<<link "Add $juniorNPC.fullname to Book of Connections" $passage>>
<<AddNPCWithFamily $juniorNPC>>
<<MissionFinishAuto>>
<</link>><br>
<<link "Depart courtyard" $passage>>
<<MissionFinishAuto>>
<</link>>
</div>
<</replace>>
<</link>><br>
<<link "Bask in their admiration">>
<<replace "#victory-choice">>
You smile knowingly as they gaze up at you with obvious respect and attraction.<br><br>
<<startStatChanges>>
<<gainStat "charisma" "basecharisma" 1 5 40 "Charisma">>
<<gainExp 280>>
<<set $juniorNPC.friendship += 5>>
<<showStatChanges>>
<div id="end-options">
<br><br>
<<link "Add $juniorNPC.fullname to Book of Connections" $passage>>
<<AddNPCWithFamily $juniorNPC>>
<<MissionFinishAuto>>
<</link>><br>
<<link "Depart courtyard" $passage>>
<<MissionFinishAuto>>
<</link>>
</div>
<</replace>>
<</link>>
</div>
<</if>>
<!-- End of Spar - Junior Wins (Bet to Collect) -->
<<elseif $pe eq 5 and $juniorWins gte 3>>
You're both breathing hard, exhausted from the intense match. $juniorNPC.fullname stands over you, eyes gleaming with victory.<br><br>
<<if $sparBetStake eq "touch your thigh">>
As you try to stand, they step into your space, pinning you lightly against the sparring post. Their hand slides warmly onto your bare thigh, squeezing the soft flesh intimately.<br><br>
<img src="images/Sex/juniorBetThigh.webp" width="600"><br><br>
You flush, struggling to maintain your composure under their bold touch as they smirk in absolute triumph.<br><br>
<<if $corruption lt 20>><<set $corruption += 2>><</if>>
<<elseif $sparBetStake eq "rest a hand on your chest">>
Without waiting for permission, they step forward and place their palm directly onto your chest. Their fingers intentionally spread wide, claiming the soft swell of your breast through your robes.<br><br>
<img src="images/Sex/juniorBetTits.webp" width="600"><br><br>
You stiffen, heat blooming in your cheeks—but they don't press harder, merely letting their hand linger possessively while staring deep into your eyes.<br><br>
<<if $corruption lt 25>><<set $corruption += 3>><</if>>
<<elseif $sparBetStake eq "feel your ass">>
Their hand slides boldly down the small of your back and settles firmly onto your ass. They knead the soft flesh aggressively through the silk of your robes, clearly savoring their prize.<br><br>
<img src="images/Sex/juniorBetAss.webp" width="600"><br><br>
You bite your lip to stifle a gasp as their fingers dig into your cheeks, enjoying the dominant display of victory.<br><br>
<<if $corruption lt 20>><<set $corruption += 3>><</if>>
<<elseif $sparBetStake eq "see your panties">>
Before you can even catch your breath, their hands are at your waist, yanking your robes high up to completely expose your panties.<br><br>
<img src="images/Sex/juniorBetPanties.webp" width="600"><br><br>
Their eyes rake hungrily over the thin fabric stretched across your crotch, their gaze burning into your obvious embarrassment. "Nice view," they mock softly.<br><br>
<<if $corruption lt 20>><<set $corruption += 3>><</if>>
<!-- EXPLICIT WAGERS -->
<<elseif $sparBetStake eq "rub your bare cunt">>
<<if $juniorNPC.gender eq "male">>
<span class="male1">"I won. Spread your legs, Senior Sister."</span><br><br>
<<else>>
<span class="female">"I won. Spread your legs, Senior Sister."</span><br><br>
<</if>>
They don't give you a choice. They push you onto your back, hauling your robes up and pulling aside your underwear to completely expose your bare sex. Two fingers immediately press against your slick folds, rubbing your sensitive clit directly.<br><br>
<img src="images/Sex/juniorBetRubCunt.webp" width="600"><br><br>
A sharp, breathy moan escapes your lips as their digits work your wet flesh right there in the middle of the training grounds. You squirm helplessly as they continuously stroke your dripping slit.<br><br>
<<if $corruption lt 45>><<set $corruption += 5>><</if>>
<<set $juniorNPC.hadSex += 1>>
<<elseif $sparBetStake eq "get a handjob from you" or $sparBetStake eq "finger your pussy">>
They yank you close, forcing you onto your knees.<br><br>
<<if $juniorNPC.gender eq "male">>
<span class="male1">"Time to pay up. Get your hands on it."</span><br><br>
He rips his pants down, exposing his thick, hard length. A drop of pre-cum is already leaking from the swollen slit. He grabs your wrist, wrapping your fingers tightly around his hot shaft. You swallow hard, forced to stroke him in deep, rhythmic pulls while he groans and twitches in your grip.<br><br>
<<else>>
<span class="female">"Time to pay up. Let's see those skilled hands of yours."</span><br><br>
She parts her robes completely, spreading her legs to show off her pink, soaking wet pussy. She guides your fingers down to her dripping slit, forcing you to plunge them deep inside. You rapidly finger her wet hole, listening to her loud, wet moans echoing in the courtyard.<br><br>
<</if>>
<img src="images/Sex/juniorBetHandjob.webp" width="600"><br><br>
<<if $corruption lt 50>><<set $corruption += 6>><</if>>
<<set $juniorNPC.hadSex += 1>>
<<elseif $sparBetStake eq "get a blowjob from you" or $sparBetStake eq "have you eat me out">>
<<if $juniorNPC.gender eq "male">>
<span class="male1">"On your knees, Senior Sister. Open wide."</span><br><br>
He shoves your shoulders down into the dirt. You kneel before him, parting your lips helplessly as he violently thrusts his thick, throbbing cock deep into your mouth. You gag slightly, forced to bob your head and suck his hot shaft, swallowing his slick pre-cum as you service him thoroughly.<br><br>
<<else>>
<span class="female">"On your knees, Senior Sister. Tongue out."</span><br><br>
She forces you down onto your back and forcefully straddles your face. You are completely smothered by her soaking wet cunt. You have no choice but to lap desperately at her dripping juices, eating her out while she aggressively grinds her swelling clit against your nose and lips.<br><br>
<</if>>
<img src="images/Sex/juniorBetOral.webp" width="600"><br><br>
<<if $corruption lt 75>><<set $corruption += 8>><</if>>
<<set $juniorNPC.hadSex += 1>>
<<elseif $sparBetStake eq "fuck your bare pussy" or $sparBetStake eq "grind against your bare pussy">>
The pretense of a "spar" is completely gone. They shove you forcefully onto your back on the hard ground, ripping your lower robes apart and tearing off your panties, leaving you completely exposed.<br><br>
<<if $juniorNPC.gender eq "male">>
<span class="male1">"You lost, Senior Sister. And now your tight little pussy belongs to me."</span><br><br>
He lines his massive, throbbing cock up with your wet, bare slit and violently buries himself deep inside you. You let out a loud, breathless scream as he begins to brutally pound you. His hips slap heavily against your thighs, ruthlessly plowing your pussy until he fills you with a hot, pulsing creampie right there on the training grounds.<br><br>
<<else>>
<span class="female">"You lost, Senior Sister. Spread them."</span><br><br>
She drops heavily between your spread thighs, pressing her bare, soaking wet pussy directly against yours. She begins to grind ruthlessly against you. Your slick clits rub together in a desperate, friction-filled rhythm, scissoring aggressively until your bodies spasm and you both climax screaming into the open air.<br><br>
<</if>>
<img src="images/Sex/juniorBetFuck.webp" width="600"><br><br>
<<if $corruption lt 90>><<set $corruption += 10>><</if>>
<<set $juniorNPC.hadSex += 1>>
<!-- Safe default if no bet -->
<<elseif $sparBetStake eq "none">>
You both collapse, laughing as you recover.<br><br>
<span class="player">"You've improved. Keep practicing."</span><br><br>
<</if>>
<<startStatChanges>>
<<gainExp 260>>
<<set $juniorNPC.friendship += 10>>
<<showStatChanges>>
<div id="end-options">
<br><br>
<<link "Add $juniorNPC.fullname to Book of Connections" $passage>>
<<AddNPCWithFamily $juniorNPC>>
<<MissionFinishAuto>>
<</link>><br>
<<link "Depart courtyard" $passage>>
<<MissionFinishAuto>>
<</link>>
</div>
<</if>>
<</widget>>
<!-- ═══════════════════════════════════════════════════════════════
NEW MISSION: Guard the Meditation Chambers (Night Watch)
═══════════════════════════════════════════════════════════════ -->
<<widget "GuardMeditationChambers01">>
Night falls over the sect. You're assigned to guard the Meditation Chambers during the midnight hours—a quiet, meditative post that few juniors enjoy.<br>
<br>
The halls are dim, lit only by night pearls in their fixtures. Your footsteps echo softly as you patrol.
<<set _encounter = random(1,5)>>
<div id="meditation-choice">
<<if _encounter lte 2>>
<br><<link "Meditate peacefully in one of the empty chambers">>
<<replace "#meditation-choice">>
Rather than patrol constantly, you settle into one of the empty meditation chambers and deepen your own cultivation.<br>
<br>
Hours pass in serene silence. Your qi flows smoothly, and you emerge refreshed, your mind clear.<br>
<br>
The Meditation Hall Master notices your balanced energy.<br>
<br>
<span class="oldman">"You have a gift for stillness, disciple."</span>
<<startStatChanges>>
<br><<gainStat "willpower" "basewillpower" 2 5 40 "Willpower">>
<br><<gainStat "spiritualRoot" "basespiritualRoot" 2 10 40 "Spiritual Root">>
<<gainExp 350>>
<<set $sectFavor += 5>>
<<set $ContributionPoints += 18>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Patrol diligently and observe others' progress">>
<<replace "#meditation-choice">>
You walk the halls carefully, ensuring no one disturbs the meditating disciples. You notice how different cultivators' auras shine—some weak, some burning bright with advancement.<br>
<br>
By dawn, you've observed much about the sect's power distribution and spiritual health.
<<startStatChanges>>
<br><<gainStat "insight" "baseinsight" 2 5 40 "Insight">>
<<gainExp 280>>
<<set $ContributionPoints += 15>>
<<set $sectFavor += 3>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<<elseif _encounter eq 3>>
At midnight, you discover a junior disciple weeping silently in one of the meditation chambers. They look distraught, their cultivation clearly disrupted by emotional turmoil.
<<CreateNPC001>>
<br><<link "Comfort them with genuine care">>
<<replace "#meditation-choice">>
You sit beside them and listen without judgment. They tell you of struggles with the sect, doubts about their path, loneliness.<br>
<br>
You offer both practical advice and emotional support. By the end, they're calmer, more centered.<br>
<br>
<span class="female">"Thank you... I needed to talk to someone."</span>
<<startStatChanges>>
<br><<gainStat "charisma" "basecharisma" 3 5 40 "Charisma">>
<br><<gainStat "willpower" "basewillpower" 1 5 40 "Willpower">>
<<gainExp 320>>
<<set $sectFavor += 6>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Use their vulnerability to seduce them ">>
<<replace "#meditation-choice">>
Their emotional state makes them malleable. You take advantage, offering comfort that gradually becomes physical.<br>
<br>
Soon you're kissing them, hands exploring trembling bodies in the dim light of the meditation chamber.
<img src="images/Sex/meditationchamber.webp" width=600>
It's not entirely consensual, and you know it. But they don't resist.
<<startStatChanges>>
<br><<gainStat "corruption" "corruption" 15 0 50 "Corruption">>
<br><<gainStat "charisma" "basecharisma" 2 5 40 "Charisma">>
<<gainExp 300>>
<<set $dualCultivationCount += 1>>
<<set $sectSuspicion += 4>>
<<showStatChanges>>
You've gained power through their despair. The guilt is faint but present.
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Suggest they speak to an Elder">>
<<replace "#meditation-choice">>
You recognize this is beyond your capacity to help properly.<br>
<br>
<span class="player">"The Counselor Elder understands these struggles. You should speak with them."</span><br>
<br>
They nod, grateful for the direction.
<<startStatChanges>>
<br><<gainStat "willpower" "basewillpower" 2 5 40 "Willpower">>
<<gainExp 250>>
<<set $sectFavor += 4>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<<elseif _encounter eq 4>>
You discover two disciples engaged in secret cultivation in one of the back chambers—a form of advanced dual cultivation that's technically forbidden without Elder approval.
<br><<link "Report them (Righteousness)">>
<<replace "#meditation-choice">>
You interrupt them and immediately report to the Meditation Hall Master. Your adherence to sect rules is commended, though the disciples will resent you.
<<startStatChanges>>
<br><<gainStat "willpower" "basewillpower" 2 5 40 "Willpower">>
<<gainExp 280>>
<<set $sectFavor += 7>>
<<set $ContributionPoints += 20>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Join them ">>
<<replace "#meditation-choice">>
You step into the chamber and close the door. The two disciples stare in shock, then quickly realize you're not there to report them.<br>
<br>
<span class="female">"Senior Sister... would you..."</span><br>
<br>
What follows is an intense night of three-way cultivation, energies intertwining in forbidden harmony.
<img src="images/Sex/threeway.webp" width=600>
<<startStatChanges>>
<br><<gainStat "corruption" "corruption" 18 0 50 "Corruption">>
<br><<gainStat "spiritualRoot" "basespiritualRoot" 3 10 40 "Spiritual Root">>
<<gainExp 400>>
<<set $dualCultivationCount += 1>>
<<set $sectSuspicion += 5>>
<<showStatChanges>>
You now have leverage over both of them. And they know it.
<<MissionFinish>>
<</replace>>
<</link>>
<<else>>
The night passes quietly. You patrol the halls, ensure everything is secure, and nothing of note occurs.
<<startStatChanges>>
<<gainExp 180>>
<<set $ContributionPoints += 12>>
<<showStatChanges>>
<<MissionFinish>>
<</if>>
</div>
<</widget>>
<!-- ═══════════════════════════════════════════════════════════════
NEW MISSION: Collect Spirit Herbs from the Forbidden Grotto
═══════════════════════════════════════════════════════════════ -->
<<widget "CollectHerbsGrotte01">>
The Elder hands you a list and a jade slip map.<br>
<br>
<span class="male1">"The Forbidden Grotto holds rare spirit herbs we need for autumn pills. You have the skills—bring back the ones marked on this map. Be careful. The grotto hasn't been entered in three years."</span><br>
<br>
You venture into the shadowy canyon. Strange qi hangs in the air—old, untamed, dangerous.
<<set _discovery = random(1,5)>>
<div id="grotto-choice">
<<if _discovery eq 1>>
<br><<link "Carefully collect only the marked herbs">>
<<replace "#grotto-choice">>
You work methodically, using proper technique to harvest each herb without damaging its spiritual essence.<br>
<br>
Hours pass. You gather everything on the list and prepare to leave, when you notice a hidden alcove you hadn't seen before.
<br><<link "Continue safely back to the sect">>
<<replace "#grotto-choice">>
You resist the temptation to explore further. Knowledge of unknown places is dangerous.
<<startStatChanges>>
<br><<gainStat "insight" "baseinsight" 2 5 40 "Insight">>
<br><<gainStat "willpower" "basewillpower" 1 5 40 "Willpower">>
<<gainExp 300>>
<<set $ContributionPoints += 20>>
<<set $sectFavor += 4>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Investigate the alcove ">>
<<replace "#grotto-choice">>
You approach cautiously. Inside is a shrine to an ancient cultivator—and a cultivation manual written in forbidden script.
<br><<link "Take it (Corruption +12)">>
<<replace "#grotto-choice">>
You carefully remove the ancient manual and hide it in your robes. The knowledge within could accelerate your growth—or doom you if discovered.
<<startStatChanges>>
<br><<gainStat "corruption" "corruption" 12 0 50 "Corruption">>
<br><<gainStat "insight" "baseinsight" 3 5 40 "Insight">>
<<gainExp 350>>
<<set $ContributionPoints += 18>>
<<set $sectSuspicion += 3>>
<<showStatChanges>>
You now possess a secret of immense value. But danger comes with it.
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Leave it untouched">>
<<replace "#grotto-choice">>
This knowledge belongs to the grotto, not to you. You respect that boundary and leave it where it lies.
<<startStatChanges>>
<br><<gainStat "willpower" "basewillpower" 2 5 40 "Willpower">>
<<gainExp 280>>
<<set $ContributionPoints += 18>>
<<set $sectFavor += 3>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<</replace>>
<</link>>
<<elseif _discovery eq 2>>
You find a rare Spirit Fox resting near the herbs you're collecting. It's beautiful, ethereal, and watching you with intelligent eyes.
<br><<link "Attempt to befriend it">>
<<replace "#grotto-choice">>
You move slowly, offering gentle energy to the fox. It approaches cautiously, and after long minutes, allows you to touch its fur.<br>
<br>
The connection is profound—ancient, almost sentient.
<img src="images/Story/spiritfox.webp" width=600>
When you finally leave, the fox doesn't follow, but you feel as if you've made a pact with something greater than yourself.
<<startStatChanges>>
<br><<gainStat "spiritualRoot" "basespiritualRoot" 3 10 40 "Spiritual Root">>
<br><<gainStat "insight" "baseinsight" 2 5 40 "Insight">>
<<gainExp 380>>
<<set $ContributionPoints += 22>>
<<set $sectFavor += 5>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Attempt to capture it ">>
<<replace "#grotto-choice">>
You try to trap the fox with binding qi, thinking it could be valuable to the sect—or to you.<br>
<br>
The fox hisses and lashes out, clawing your arm. You release it immediately, and it vanishes into the shadows.
<<startStatChanges>>
<br><<gainStat "corruption" "corruption" 3 0 50 "Corruption">>
<br><<gainStat "agility" "baseagility" 1 7 40 "Agility">>
<<gainExp 220>>
<<set $health to Math.max(0, $health - 20)>>
<<showStatChanges>>
You escaped, but barely. The grotto feels hostile now.
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Leave it alone and continue working">>
<<replace "#grotto-choice">>
You acknowledge the fox's presence respectfully and focus on your task. It watches but doesn't interfere.
<<startStatChanges>>
<<gainExp 280>>
<<set $ContributionPoints += 18>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<<elseif _discovery eq 3>>
While gathering herbs, you discover evidence of another cultivator—recently, within days. Footprints, disturbed plants, even the remnants of a small camp.<br>
<br>
Someone else is accessing the forbidden grotto.
<br><<link "Report this to the Elders">>
<<replace "#grotto-choice">>
You bring the discovery to the authorities. They're concerned and grateful for your vigilance.<br>
<br>
<span class="male1">"This is serious. We may have an intruder. You did well."</span>
<<startStatChanges>>
<br><<gainStat "willpower" "basewillpower" 2 5 40 "Willpower">>
<<gainExp 320>>
<<set $sectFavor += 8>>
<<set $ContributionPoints += 25>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Investigate further yourself ">>
<<replace "#grotto-choice">>
You follow the traces, curious about who has access to this place. You find a hidden cave where someone has been cultivating in secret.<br>
<br>
Evidence suggests it's one of the sect's own—someone powerful and careful.
<br><<link "Leave it alone and report nothing">>
<<replace "#grotto-choice">>
You back away quietly. This person—whoever they are—has chosen secrecy. Interfering could be dangerous.
<<startStatChanges>>
<br><<gainStat "insight" "baseinsight" 2 5 40 "Insight">>
<<gainExp 300>>
<<set $ContributionPoints += 15>>
<<showStatChanges>>
You now carry a dangerous secret. Information is power.
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Use this knowledge to blackmail them ">>
<<replace "#grotto-choice">>
You leave a message in their hidden cave—subtle, but clear: you know they're here, and you expect compensation for your silence.<br>
<br>
<br><<gainStat "corruption" "corruption" 3 0 50 "Corruption">>
<br>
They don't respond, but resources appear in your quarters within days. The arrangement is understood.
<<startStatChanges>>
<<gainExp 280>>
<<set $gold += 300>>
<<set $sectSuspicion += 5>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<</replace>>
<</link>>
<<else>>
You collect the herbs smoothly. Nothing unusual occurs.
<<startStatChanges>>
<<gainExp 250>>
<<set $ContributionPoints += 16>>
<<showStatChanges>>
<<MissionFinish>>
<</if>>
</div>
<</widget>>
<!-- ═══════════════════════════════════════════════════════════════
NEW MISSION: Assist with Sect Festival Preparations
═══════════════════════════════════════════════════════════════ -->
<<widget "SectFestivalPrep01">>
The Sect Festival is in three days, and Elder Liu needs help preparing. You're assigned to organize decorations, arrange the performance stage, and coordinate with various disciples.<br>
<br>
It's social work, but important for sect morale.
<<set _stage = random(1,4)>>
<div id="festival-choice">
<<if _stage eq 1>>
<br><<link "Organize the decorations with careful artistry">>
<<replace "#festival-choice">>
You work with several other disciples, arranging silk banners, spirit lanterns, and ritual flowers. Your eye for beauty makes the courtyard stunning.<br>
<br>
Other disciples comment on your aesthetic sense.<br>
<br>
<span class="female">"Senior Sister, this is beautiful!"</span>
<<startStatChanges>>
<br><<gainStat "charisma" "basecharisma" 2 5 40 "Charisma">>
<<gainExp 280>>
<<set $sectFame += 3>>
<<set $ContributionPoints += 18>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Delegate tasks and supervise efficiently">>
<<replace "#festival-choice">>
You organize the other workers effectively, assigning tasks based on their skills. Everyone knows what to do, and the work finishes ahead of schedule.
<<startStatChanges>>
<br><<gainStat "charisma" "basecharisma" 1 5 40 "Charisma">>
<br><<gainStat "willpower" "basewillpower" 1 5 40 "Willpower">>
<<gainExp 250>>
<<set $ContributionPoints += 20>>
<<set $sectFavor += 3>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<<elseif _stage eq 2>>
You're helping arrange the food and drink for the festival. A junior disciple—particularly attractive—is assigned to help you.
<<CreateNPC001>>
<<set $festivalNPC to clone(_npc)>>
<<if _npc.gender eq "female">>
<span class="female">"Senior Sister, where should the spirit wine go?"</span> she asks, struggling a bit with a heavy cask.
<<else>>
<span class="male1">"Senior Sister, where should the spirit wine go?"</span> he asks, struggling a bit with a heavy cask.
<</if>>
<br><<link "Help them with the cask professionally">>
<<replace "#festival-choice">>
You take the cask together, your hands briefly touching. You guide them in proper storage technique.
<<startStatChanges>>
<br><<gainStat "charisma" "basecharisma" 1 5 40 "Charisma">>
<<gainExp 220>>
<<set $ContributionPoints += 15>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Use the moment to flirt ">>
<<replace "#festival-choice">>
As you work, you stand unnecessarily close. Your hands linger when taking the cask.<br>
<br>
<span class="player">"You're stronger than you look. I like that."</span><br>
<br>
They blush deeply.
<<startStatChanges>>
<br><<gainStat "charisma" "basecharisma" 2 5 40 "Charisma">>
<br><<gainStat "corruption" "corruption" 6 0 50 "Corruption">>
<<gainExp 240>>
<<set $ContributionPoints += 14>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<<elseif _stage eq 3>>
You're coordinating the performance stage with musicians and martial artists. There's creative tension between different performers about who gets prime time slots.
<br><<link "Mediate fairly between everyone">>
<<replace "#festival-choice">>
You listen to each performer's needs and arrange a schedule that satisfies most people. It requires diplomacy and fairness.<br>
<br>
<span class="male1">"You have a gift for balance, Senior Sister."</span>
<<startStatChanges>>
<br><<gainStat "charisma" "basecharisma" 3 5 40 "Charisma">>
<<gainExp 300>>
<<set $sectFame += 4>>
<<set $ContributionPoints += 20>>
<<set $sectFavor += 4>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<br><<link "Give preference to the most attractive performers ">>
<<replace "#festival-choice">>
You arrange the schedule to feature the most beautiful disciples, regardless of actual talent. It's shallow, but you enjoy the view.
<<startStatChanges>>
<br><br><<gainStat "corruption" "corruption" 2 0 50 "Corruption">>
<<gainExp 250>>
<<set $ContributionPoints += 15>>
<<showStatChanges>>
The performances will be... visually interesting, at least.
<<MissionFinish>>
<</replace>>
<</link>>
<<else>>
<br><<link "Help with all aspects of preparation">>
<<replace "#festival-choice">>
You throw yourself into various tasks—decorations, coordination, problem-solving. By the time the festival arrives, you're exhausted but satisfied.<br>
<br>
The Elder thanks you directly.<br>
<br>
<span class="male1">"Your contribution was invaluable. The festival will be remembered."</span>
<<startStatChanges>>
<br><<gainStat "willpower" "basewillpower" 2 5 40 "Willpower">>
<<gainExp 320>>
<<set $sectFame += 5>>
<<set $sectFavor += 5>>
<<set $ContributionPoints += 25>>
<<showStatChanges>>
<<MissionFinish>>
<</replace>>
<</link>>
<</if>>
</div>
<</widget>><<widget "PatrolPerimeter01Submissive">>
<<nobr>>
<<set $missionpassage = $args[0] ?? $passage>>
/* Mission‑specific effects */
<<set $currentMissionEffects = {
corruption: random(3,5),
sexFame: 4,
righteousreputation: -2,
logTitle: "Mission Submission",
logDesc: "You submitted to a junior during a patrol, deepening your corruption."
}>>
<<set $missionDominance = "sub">>
<<set _partner = $juniorNPC>>
<<set $sexType = "mission_sex">>
<<set $sexReturnPassage = $missionpassage>>
<<goto "EncounterInteractionSex">>
<</nobr>>
<</widget>>
<<widget "PatrolPerimeter01Dominant">>
<<nobr>>
<<set $missionpassage = $args[0] ?? $passage>>
/* Mission‑specific effects */
<<set $currentMissionEffects = {
corruption: random(2,4),
sexFame: 4,
righteousreputation: -2,
logTitle: "Mission Dominance",
logDesc: "You took control of a junior during a patrol, asserting your authority."
}>>
<<set $missionDominance = "dom">>
<<set _partner = $juniorNPC>>
<<set $sexType = "mission_sex">>
<<set $sexReturnPassage = $missionpassage>>
<<goto "EncounterInteractionSex">>
<</nobr>>
<</widget>>
<<widget "PatrolPerimeter01Neutral">>
<<nobr>>
<<set $missionpassage = $args[0] ?? $passage>>
/* Mission‑specific effects */
<<set $currentMissionEffects = {
corruption: random(2,4),
sexFame: 4,
righteousreputation: -2,
logTitle: "Mission Indulgence",
logDesc: "You shared an intimate moment with a junior during a patrol."
}>>
<<set $missionDominance = "neutral">>
<<set _partner = $juniorNPC>>
<<set $sexType = "mission_sex">>
<<set $sexReturnPassage = $missionpassage>>
<<goto "EncounterInteractionSex">>
<</nobr>>
<</widget>><<set $playerBeast = []>>
<<set $beastGrowthStages = ["Infant", "Young", "Adult", "Evolved"]>>
<<set $BeastBloodlines to [
"Vermilion Phoenix Lineage",
"Azure Dragon Blood",
"White Tiger War Soul",
"Black Tortoise Eternal Shell",
"Golden Qilin Blessing",
"Nine-Tailed Celestial Fox Fragment",
"Abyss Serpent King Lineage",
"Thunder Roc Bloodline",
"Moonshadow Wolf Ancestor Line",
"Star-Eating Crow Fragment",
"Iron Mountain Boar Titan Line",
"Spirit Vine Entity Core",
"Mist Deer Spirit Line",
"Sandstorm Viper Line",
"Crimson Scale Lizard",
"Frostbite Owl Clan",
"Void-Scale Serpent",
"Half-Dragon Failed Fusion Line",
"Demon Beast Hybrid Seed",
"Soul-Scarred Mutant Core",
"Artificial Spirit Construct Core",
"Dream-Eating Butterfly Line"
]>>
<<set $BeastPersonalities to [
"Loyal","Proud","Aggressive","Playful","Cold",
"Skittish","Curious","Protective","Lazy",
"Wild","Scheming","Territorial","Affectionate",
"Emotionally unstable","Paranoid"
]>>
<<set $BeastTraits to [
"Bloodthirsty instinct",
"Rapid regeneration",
"Fast evolution",
"Late bloomer",
"Stable lineage",
"Mutation-prone",
"Near-human intelligence",
"Jealous companion behavior",
"Energy absorption",
"Protective obsession",
"Adaptive combat style",
"Territory dominance aura",
"Emotional resonance growth",
"Night-active predator",
"Stealth specialist",
"Pack instinct behavior",
"Predator intimidation aura"
]>>
/* ── Rarity pools ── */
<<set $BeastRarityPools to {
"Common": {
bloodlines: [
"Crimson Scale Lizard",
"Iron Mountain Boar Titan Line",
"Sandstorm Viper Line",
"Mist Deer Spirit Line",
"Frostbite Owl Clan"
],
traits: [
"Stable lineage",
"Late bloomer",
"Pack instinct behavior",
"Night-active predator",
"Stealth specialist"
],
traitCount: 2,
statMult: 1.0,
priceBase: 200
},
"Uncommon": {
bloodlines: [
"Moonshadow Wolf Ancestor Line",
"Spirit Vine Entity Core",
"Void-Scale Serpent",
"Thunder Roc Bloodline"
],
traits: [
"Rapid regeneration",
"Adaptive combat style",
"Territory dominance aura",
"Fast evolution",
"Stable lineage",
"Night-active predator"
],
traitCount: 2,
statMult: 1.5,
priceBase: 450
},
"Rare": {
bloodlines: [
"Abyss Serpent King Lineage",
"Star-Eating Crow Fragment",
"Nine-Tailed Celestial Fox Fragment"
],
traits: [
"Bloodthirsty instinct",
"Predator intimidation aura",
"Energy absorption",
"Mutation-prone",
"Rapid regeneration",
"Adaptive combat style"
],
traitCount: 3,
statMult: 2.0,
priceBase: 900
},
"Legendary": {
bloodlines: [
"Azure Dragon Blood",
"White Tiger War Soul",
"Black Tortoise Eternal Shell",
"Golden Qilin Blessing"
],
traits: [
"Near-human intelligence",
"Protective obsession",
"Emotional resonance growth",
"Jealous companion behavior",
"Bloodthirsty instinct",
"Energy absorption",
"Predator intimidation aura"
],
traitCount: 3,
statMult: 3.0,
priceBase: 2500
},
"Mythic": {
bloodlines: [
"Vermilion Phoenix Lineage"
],
traits: [
"Near-human intelligence",
"Protective obsession",
"Emotional resonance growth",
"Jealous companion behavior",
"Bloodthirsty instinct",
"Energy absorption",
"Predator intimidation aura",
"Mutation-prone",
"Territory dominance aura",
"Fast evolution"
],
traitCount: 3,
statMult: 5.0,
priceBase: 8000
},
"Special": {
bloodlines: [
"Half-Dragon Failed Fusion Line",
"Demon Beast Hybrid Seed",
"Soul-Scarred Mutant Core",
"Artificial Spirit Construct Core",
"Dream-Eating Butterfly Line"
],
traits: [
"Mutation-prone",
"Near-human intelligence",
"Emotional resonance growth",
"Bloodthirsty instinct",
"Jealous companion behavior",
"Adaptive combat style",
"Protective obsession"
],
traitCount: 3,
statMult: 2.5,
priceBase: 1200
}
}>>
/* ── Species name lookup from bloodline ── */
<<set $BeastSpeciesName to {
/* ── Original bloodlines — renamed ── */
"Vermilion Phoenix Lineage": "Vermilion Phoenix",
"Azure Dragon Blood": "Azure Dragon",
"White Tiger War Soul": "White Tiger",
"Black Tortoise Eternal Shell": "Black Tortoise",
"Golden Qilin Blessing": "Golden Qilin",
"Nine-Tailed Celestial Fox Fragment":"Celestial Fox",
"Abyss Serpent King Lineage": "Abyss Serpent",
"Thunder Roc Bloodline": "Thunder Roc",
"Moonshadow Wolf Ancestor Line": "Moonshadow Wolf",
"Star-Eating Crow Fragment": "Void Crow",
"Iron Mountain Boar Titan Line": "Iron Mountain Boar",
"Spirit Vine Entity Core": "Spirit Vine Wraith",
"Mist Deer Spirit Line": "Mist Deer",
"Sandstorm Viper Line": "Sandstorm Viper",
"Crimson Scale Lizard": "Crimson Scale Drake",
"Frostbite Owl Clan": "Frostbite Owl",
"Void-Scale Serpent": "Void Serpent",
"Half-Dragon Failed Fusion Line": "Fractured Drake",
"Demon Beast Hybrid Seed": "Demon Hybrid",
"Soul-Scarred Mutant Core": "Soul-Scarred Beast",
"Artificial Spirit Construct Core": "Spirit Construct",
"Dream-Eating Butterfly Line": "Dream Butterfly",
/* ── From existing beast widgets ── */
"Windhare Spirit Lineage": "Windhare Spirit",
"Yang Flame Fox Heritage": "Yang Flame Fox",
"Silver Mist Panther Line": "Silver Mist Panther",
"Jade Shell Tortoise Ancient Line": "Jade Shell Tortoise",
"Thunder Wasp Queen Bloodline": "Thunder Wasp Queen",
"Void-Eyed Crow Bloodline": "Void-Eyed Crow",
"Glacial Serpent Elder Line": "Glacial Serpent",
"Frostclaw Bear Bloodline": "Frostclaw Bear",
"Sorrow Peak Ape Lineage": "Sorrow Peak Ape"
}>>
/* ── Stat bonus base by species ── */
<<set $BeastStatBase to {
/* ── Legendary/Mythic — high base stats ── */
"Vermilion Phoenix": {baseatk: 4, insight: 3, luck: 2},
"Azure Dragon": {baseatk: 5, basedef: 3, basewillpower: 2},
"White Tiger": {baseatk: 5, agility: 3, crit: 2},
"Black Tortoise": {basedef: 5, basewillpower: 4},
"Golden Qilin": {luck: 4, insight: 4, basewillpower: 2},
/* ── Rare ── */
"Celestial Fox": {insight: 4, evadescore: 4, luck: 2},
"Abyss Serpent": {baseatk: 3, crit: 3, agility: 2},
"Void Crow": {insight: 5, luck: 3},
/* ── Uncommon ── */
"Thunder Roc": {agility: 4, evadescore: 3, baseatk: 2},
"Moonshadow Wolf": {agility: 3, baseatk: 3, crit: 2},
"Void Serpent": {agility: 3, crit: 3, evadescore: 2},
"Spirit Vine Wraith": {basewillpower: 4, insight: 3},
/* ── Common ── */
"Mist Deer": {luck: 3, evadescore: 3},
"Sandstorm Viper": {crit: 3, agility: 2},
"Crimson Scale Drake": {basedef: 3, baseatk: 2},
"Frostbite Owl": {insight: 3, evadescore: 2},
"Iron Mountain Boar": {basedef: 3, baseatk: 3},
/* ── Special ── */
"Fractured Drake": {baseatk: 3, basedef: 3, crit: 2},
"Demon Hybrid": {baseatk: 3, agility: 2, crit: 3},
"Soul-Scarred Beast": {crit: 4, insight: 2, baseatk: 2},
"Spirit Construct": {basedef: 4, basewillpower: 3},
"Dream Butterfly": {insight: 4, luck: 4},
/* ── From existing beast widgets ── */
"Windhare Spirit": {evadescore: 4, luck: 3},
"Yang Flame Fox": {baseatk: 3, insight: 3, crit: 2},
"Silver Mist Panther": {agility: 4, evadescore: 3},
"Jade Shell Tortoise": {basedef: 4, basewillpower: 3},
"Thunder Wasp Queen": {baseatk: 3, crit: 4},
"Void-Eyed Crow": {insight: 5, luck: 3},
"Glacial Serpent": {agility: 3, crit: 3, insight: 2},
"Frostclaw Bear": {baseatk: 4, basedef: 4},
"Sorrow Peak Ape": {baseatk: 5, basedef: 3}
}>>
/* ── Heat behavior by personality ── */
<<set $BeastHeatBehavior to {
"Loyal": "It stays close — too close. Won't leave your side, presses against you whenever you stop moving. At night it curls over you with deliberate weight.",
"Proud": "It refuses to acknowledge what's happening, but its body betrays it completely. It won't meet your eyes and keeps finding reasons to be touching you.",
"Aggressive": "It becomes demanding in a way that can't be misread — nudging, nipping, pushing until it has your full attention. It won't be redirected.",
"Playful": "It treats this like a game only it knows the rules of. Every touch is framed as play. The intent underneath is not playful at all.",
"Cold": "It doesn't change its expression. It simply acts — directly, without preamble, without asking. Its temperature runs noticeably higher than usual.",
"Skittish": "It startles at sudden movements but keeps returning. Heat makes it brave in a way nothing else does. It trembles but it doesn't leave.",
"Curious": "It approaches everything about you with unusual focus — scent, sound, warmth. It catalogs you. The attention is overwhelming.",
"Protective": "It won't let anything near you, including distance. It interposes itself between you and any space, any door, any gap.",
"Lazy": "It moves less than usual but demands more. Pulls you down to its level, makes itself impossible to ignore without effort.",
"Wild": "Its instincts override everything learned. It reverts to something older and more direct. No pretense. No subtlety.",
"Scheming": "It has arranged the situation carefully before you noticed anything was wrong. You are already where it wants you.",
"Territorial": "It becomes extremely sensitive to the scent of anyone else on you. Demands to replace it. Insistently.",
"Affectionate": "Heat makes what is normally warm become consuming. It wants contact at every point. It makes small distressed sounds when you move away.",
"Emotionally unstable":"It cycles — desperate, then ashamed, then desperate again. It doesn't know what to do with what it's feeling and neither do you.",
"Paranoid": "It is convinced you will leave during this. It holds on. Everything it does is about preventing distance."
}>><!-- ═════════════════════════════════════════════════════════════
ADVANCEMENT CHECK WIDGET
Checks if player can advance to next rank
═════════════════════════════════════════════════════════════ -->
<<widget "CheckRankAdvancement">>
/* $args[0]: rank to check */
<<set _rankToCheck to $args[0]>>
<<set _canAdvance to false>>
<<if _rankToCheck eq "Initiate">>
<<set _canAdvance to $ContributionPoints >= 50 and $CurrentPcSectReputation >= 10 and $sectFavor >= 5>>
<<elseif _rankToCheck eq "Disciple">>
<<set _canAdvance to $ContributionPoints >= 150 and $CurrentPcSectReputation >= 30 and $sectFavor >= 15>>
<<elseif _rankToCheck eq "Inner Disciple">>
<<set _canAdvance to $ContributionPoints >= 300 and $CurrentPcSectReputation >= 60 and $sectFavor >= 30>>
<<elseif _rankToCheck eq "Core Disciple">>
<<set _canAdvance to $ContributionPoints >= 600 and $CurrentPcSectReputation >= 100 and $sectFavor >= 50>>
<</if>>
<<print _canAdvance>>
<</widget>><<widget "TournamentArenaSurvival">>
<script>
(function() {
var GRID = 12;
var NPC_TEMPLATES = [
{ name:"Lustful Sword Sister", tag:"sword_sister", color:"#ff69b4", desc:"curvaceous sword cultivator", icon:"⚔️", shortTag:"SS", atk:14, hpBase:70, robeDmgChance:0.0 },
{ name:"Brute Yang Cultivator", tag:"yang_brute", color:"#ff4500", desc:"muscular bare-chested fighter", icon:"💪", shortTag:"YB", atk:18, hpBase:90, robeDmgChance:0.1 },
{ name:"Slippery Fox Spirit", tag:"fox_spirit", color:"#ba55d3", desc:"seductive fox-eared beauty", icon:"🦊", shortTag:"FS", atk:12, hpBase:65, robeDmgChance:0.4 },
{ name:"Cold Yin Beauty", tag:"yin_beauty", color:"#00bfff", desc:"ice-cold elegant lady", icon:"❄️", shortTag:"YN", atk:13, hpBase:68, robeDmgChance:0.0 },
{ name:"Frenzied Dual Cultivator",tag:"dual_cult", color:"#ff1493", desc:"shameless hedonist", icon:"💃", shortTag:"DC", atk:15, hpBase:72, robeDmgChance:0.2 },
{ name:"Shadow Phantom Dancer", tag:"phantom", color:"#9370db", desc:"elusive shadow-step assassin", icon:"🌑", shortTag:"PH", atk:20, hpBase:55, robeDmgChance:0.6 },
{ name:"Wild Beast Tamer", tag:"beast_tamer", color:"#8b4513", desc:"feral warrior bonded with spirits", icon:"🐯", shortTag:"BT", atk:16, hpBase:80, robeDmgChance:0.1 },
{ name:"Heavenly Thunder Monk", tag:"thunder_monk", color:"#f0e040", desc:"shaven-headed lightning cultivator", icon:"⚡", shortTag:"TM", atk:17, hpBase:85, robeDmgChance:0.0 },
{ name:"Poison Lotus Maiden", tag:"poison_lotus", color:"#7fff00", desc:"slender beauty concealing lethal toxins",icon:"🌸", shortTag:"PL", atk:11, hpBase:60, robeDmgChance:0.3 },
{ name:"Drunk Sword Saint", tag:"drunk_saint", color:"#d2691e", desc:"swaying master whose chaos hides genius",icon:"🍶", shortTag:"DS", atk:22, hpBase:75, robeDmgChance:0.0 }
];
if (!window.AR) window.AR = {};
var A = window.AR;
// Fallback defaults
if (!A.safeZone) A.safeZone = { minX:0, maxX:GRID-1, minY:0, maxY:GRID-1 };
if (A.shrinkTimer === undefined) A.shrinkTimer = 25;
function rnd(min, max) { return min + Math.random() * (max - min); }
function dist(ax,ay,bx,by) { return Math.abs(ax-bx)+Math.abs(ay-by); }
function log(msg) {
if (!A.events) A.events = [];
A.events.unshift(msg);
if (A.events.length > 8) A.events.pop();
var el = document.getElementById("ar-log");
if (!el) return;
el.innerHTML = A.events
.map(function(e){ return '<p style="margin:2px 0;color:#bbb;font-size:0.85em;">'+e+'</p>'; })
.join('');
}
function damageRobe(amount) {
var sv = SugarCube.State.variables;
if (!sv.equippedRobe || sv.equippedRobe.durability === undefined) return;
var old = sv.equippedRobe.durability;
sv.equippedRobe.durability = Math.max(0, old - amount);
var lost = old - sv.equippedRobe.durability;
if (lost > 0) {
log("Your robe is torn! Durability: " + sv.equippedRobe.durability);
}
}
function initArena() {
if (A.grid) return;
A.timeLeft = 180;
A.tickCount = 0;
A.isRunning = true;
A.events = [];
A.safeZone = { minX:0, maxX:GRID-1, minY:0, maxY:GRID-1 };
A.shrinkTimer = 25;
A.grid = [];
for (var r=0;r<GRID;r++){A.grid[r]=[];for(var c=0;c<GRID;c++)A.grid[r][c]=null;}
var sv = SugarCube.State.variables;
A.player = {
x:6, y:6,
health: Math.max(10, +(sv.health || 100)),
energy: Math.max(10, +(sv.energy || 100)),
kills:0
};
A.grid[6][6] = "player";
A.npcs = [];
var taken = {"6,6":true};
for (var i=0;i<12;i++){
var tpl = NPC_TEMPLATES[Math.floor(Math.random()*NPC_TEMPLATES.length)];
var x,y,key,tries=0;
do { x=Math.floor(Math.random()*GRID); y=Math.floor(Math.random()*GRID); key=x+","+y; tries++; }
while (taken[key] && tries<40);
if(tries>=40) continue;
taken[key]=true;
A.npcs.push({
id:i, tag:tpl.tag, name:tpl.name+"#"+(i+1),
baseName:tpl.name, short:tpl.shortTag, icon:tpl.icon,
color:tpl.color, desc:tpl.desc,
x:x, y:y, hp:tpl.hpBase+rnd(0,20), maxHp:tpl.hpBase+20,
atk:tpl.atk+rnd(-3,3), isAlive:true, kills:0,
robeDmgChance: tpl.robeDmgChance
});
A.grid[y][x]="npc_"+i;
}
log("Arena begins — "+A.npcs.length+" combatants!");
}
function render() {
var arEl = document.getElementById("ar-grid");
if (!arEl) return;
var sz = A.safeZone || { minX:0, maxX:GRID-1, minY:0, maxY:GRID-1 };
var html = "";
for (var row=0;row<GRID;row++){
for (var col=0;col<GRID;col++){
var cell = A.grid[row][col];
var bg="#1a1a1a", content="·", color="#444", ttl="", border="1px solid #2a2a2a";
if (col < sz.minX || col > sz.maxX || row < sz.minY || row > sz.maxY) {
bg="#330000"; border="1px solid #600";
}
if (cell==="player") {
bg="#1e3a5f"; content="🟦"; ttl="You"; border="1px solid #4af";
} else if (cell && cell.indexOf("npc_")===0) {
var idx=parseInt(cell.split("_")[1],10);
var n=A.npcs[idx];
if (n && n.isAlive && n.hp>0) {
bg=n.color; content=n.short; color="#000";
ttl=n.name+" HP:"+Math.ceil(n.hp); border="1px solid #fff3";
} else {
bg="#1a1a1a"; content="☠"; color="#555";
}
}
html+='<div onclick="AR_click('+col+','+row+')" title="'+ttl+'" '
+'style="width:38px;height:38px;display:flex;align-items:center;justify-content:center;'
+'font-size:12px;font-weight:bold;cursor:pointer;user-select:none;'
+'background:'+bg+';color:'+color+';border:'+border+';">'+content+'</div>';
}
}
arEl.innerHTML = html;
var alive = A.npcs.filter(function(n){return n.isAlive&&n.hp>0;}).length;
var hpEl = document.getElementById("ar-health");
var enEl = document.getElementById("ar-energy");
var tm = document.getElementById("ar-time");
var kl = document.getElementById("ar-kills");
var al = document.getElementById("ar-alive");
var sh = document.getElementById("ar-shrink");
if(hpEl) hpEl.textContent = Math.max(0,Math.floor(A.player.health));
if(enEl) enEl.textContent = Math.max(0,Math.floor(A.player.energy));
if(tm) tm.textContent = Math.max(0,Math.floor(A.timeLeft));
if(kl) kl.textContent = A.player.kills;
if(al) al.textContent = alive;
if(sh) sh.textContent = Math.ceil(A.shrinkTimer || 0);
}
window.AR_move = function(dx,dy) {
if (!A.isRunning) return;
var nx=A.player.x+dx, ny=A.player.y+dy;
if (nx<0||nx>=GRID||ny<0||ny>=GRID) return;
var cell = A.grid[ny][nx];
if (cell && cell.indexOf("npc_")===0) {
var idx=parseInt(cell.split("_")[1],10);
if (A.npcs[idx]&&A.npcs[idx].isAlive) { triggerQTE(idx, false); return; }
}
A.grid[A.player.y][A.player.x]=null;
A.player.x=nx; A.player.y=ny;
A.grid[ny][nx]="player";
render();
};
window.AR_click = function(x,y) {
if (!A.isRunning) return;
var dx=x-A.player.x, dy=y-A.player.y;
if (Math.abs(dx)>1||Math.abs(dy)>1) return;
var cell=A.grid[y][x];
if (cell&&cell.indexOf("npc_")===0) {
var idx=parseInt(cell.split("_")[1],10);
if (A.npcs[idx]&&A.npcs[idx].isAlive) triggerQTE(idx, false);
} else if (!(dx===0&&dy===0)) {
AR_move(dx,dy);
}
};
window.AR_technique = function() {
if (!A.isRunning) return;
if (A.player.energy < 15) { log("Not enough Energy!"); return; }
A.player.energy -= 15;
var hits=0;
A.npcs.forEach(function(n){
if (n.isAlive && dist(n.x,n.y,A.player.x,A.player.y)<=2) {
n.hp-=35; hits++;
if (n.hp<=0){ n.isAlive=false; A.player.kills++; }
}
});
log("Technique released! Hit "+hits+" opponents.");
render();
};
function startTick() {
if (A.tickInterval) { clearInterval(A.tickInterval); A.tickInterval = null; }
A.lastTick = Date.now();
A.tickInterval = setInterval(function(){
try {
if (!A.isRunning) return;
if (!document.getElementById("ar-grid")) {
clearInterval(A.tickInterval);
A.tickInterval = null;
A.isRunning = false;
return;
}
var now = Date.now();
var delta = (now - A.lastTick) / 1000;
A.lastTick = now;
A.timeLeft -= delta;
A.tickCount += 1;
// Check win condition (all enemies dead)
var aliveCount = A.npcs.filter(function(n){return n.isAlive&&n.hp>0;}).length;
if (aliveCount === 0) {
endArena(true); // win
return;
}
if (A.timeLeft <= 0) {
endArena(false); // time up -> lose
return;
}
// ========== Shrink Arena ==========
A.shrinkTimer -= delta;
if (A.shrinkTimer <= 0) {
A.shrinkTimer = 25;
var sz = A.safeZone || { minX:0, maxX:GRID-1, minY:0, maxY:GRID-1 };
if (sz.minX < sz.maxX) { sz.minX++; sz.maxX--; }
if (sz.minY < sz.maxY) { sz.minY++; sz.maxY--; }
A.safeZone = sz;
log("The arena walls close in! Zone shrinks.");
}
// Damage to anyone outside the safe zone
var sz = A.safeZone || { minX:0, maxX:GRID-1, minY:0, maxY:GRID-1 };
if (A.player.x < sz.minX || A.player.x > sz.maxX ||
A.player.y < sz.minY || A.player.y > sz.maxY) {
A.player.health -= 10 * delta;
if (A.player.health <= 0) { A.player.health = 0; endArena(false); return; }
}
A.npcs.forEach(function(n) {
if (!n.isAlive || n.hp <= 0) return;
if (n.x < sz.minX || n.x > sz.maxX || n.y < sz.minY || n.y > sz.maxY) {
n.hp -= 10 * delta;
if (n.hp <= 0) { n.isAlive = false; A.player.kills++; log(n.short+" died outside the zone."); }
}
});
// --- Movement ---
var g=[];
for(var r=0;r<GRID;r++){g[r]=[];for(var c=0;c<GRID;c++)g[r][c]=null;}
g[A.player.y][A.player.x]="player";
for (var i=0;i<A.npcs.length;i++){
var npc=A.npcs[i];
if (!npc.isAlive || npc.hp<=0) continue;
var tgt = findTarget(npc);
if (tgt) {
var dx=tgt.x-npc.x, dy=tgt.y-npc.y;
var mx=0, my=0;
if (Math.abs(dx)>Math.abs(dy)) mx=Math.sign(dx); else my=Math.sign(dy);
var nx2=Math.max(0,Math.min(GRID-1,npc.x+mx));
var ny2=Math.max(0,Math.min(GRID-1,npc.y+my));
if (!g[ny2][nx2]) { npc.x=nx2; npc.y=ny2; }
}
// Check adjacency to player -> QTE with first strike
if (dist(npc.x,npc.y,A.player.x,A.player.y)===1) {
if (!g[npc.y][npc.x]) g[npc.y][npc.x]="npc_"+i;
A.grid=g; render();
// NPC first strike
var firstStrikeDamage = Math.floor(npc.atk * 0.7);
A.player.health -= firstStrikeDamage;
var robeDamaged = false;
if (Math.random() < (npc.robeDmgChance || 0)) {
damageRobe(5 + Math.floor(Math.random()*10));
robeDamaged = true;
}
log(npc.baseName + " attacks first! -" + firstStrikeDamage + " HP" + (robeDamaged ? " (robe torn!)" : ""));
if (A.player.health <= 0) { A.player.health = 0; endArena(false); return; }
triggerQTE(i, true);
return;
}
if (!g[npc.y][npc.x]) g[npc.y][npc.x]="npc_"+i;
}
// --- NPC vs NPC combat ---
for (var a=0;a<A.npcs.length;a++){
var na=A.npcs[a]; if(!na.isAlive||na.hp<=0) continue;
for (var b=a+1;b<A.npcs.length;b++){
var nb=A.npcs[b]; if(!nb.isAlive||nb.hp<=0) continue;
if (dist(na.x,na.y,nb.x,nb.y)===1){
var ra=Math.random()*20+na.atk, rb=Math.random()*20+nb.atk;
if (ra>rb){ nb.hp-=12; if(nb.hp<=0){nb.isAlive=false;na.kills++;log(na.short+" defeats "+nb.short+"!");}}
else { na.hp-=12; if(na.hp<=0){na.isAlive=false;nb.kills++;log(nb.short+" defeats "+na.short+"!");}}
}
}
}
// Clamp all NPC positions to grid (safety)
A.npcs.forEach(function(n){
if (n.isAlive && n.hp>0) {
n.x = Math.max(0, Math.min(GRID-1, n.x));
n.y = Math.max(0, Math.min(GRID-1, n.y));
}
});
A.grid=g; render();
} catch(e) {
console.error("Arena tick error:", e);
}
}, 1000);
}
function findTarget(npc){
var bestDist = Infinity, best = null;
var dP = dist(npc.x, npc.y, A.player.x, A.player.y);
if (dP < bestDist) { bestDist = dP; best = A.player; }
A.npcs.forEach(function(o){
if (o.id === npc.id || !o.isAlive || o.hp <= 0) return;
var d = dist(npc.x, npc.y, o.x, o.y);
if (d < bestDist) { bestDist = d; best = o; }
});
return best;
}
window.triggerQTE = function(idx, firstStrike){
var npc=A.npcs[idx];
if(!npc||!npc.isAlive||npc.hp<=0) return;
A.isRunning=false;
if(A.tickInterval){ clearInterval(A.tickInterval); A.tickInterval=null; }
SugarCube.State.variables.qteNpc = {
id:npc.id, idx:idx, tag:npc.tag,
name:npc.name, baseName:npc.baseName,
desc:npc.desc, color:npc.color,
hp:Math.ceil(npc.hp), icon:npc.icon,
firstStrike: firstStrike || false
};
SugarCube.Engine.play("ArenaSurvivalQTE");
};
window.AR_qteResult = function(success){
var sv = SugarCube.State.variables;
var npc = A.npcs[sv.qteNpc.idx];
if (!npc) return;
if (success){
A.player.energy -= 8;
npc.hp -= 35;
if (npc.hp<=0){ npc.isAlive=false; A.player.kills++; log("You defeated "+npc.baseName+"!"); }
else { log(npc.baseName+" staggers back..."); }
} else {
A.player.health -= 15;
log(npc.baseName+" lands a solid hit on you! -15 HP");
if (Math.random() < (npc.robeDmgChance || 0)) {
damageRobe(10 + Math.floor(Math.random()*15));
}
}
sv.health = Math.max(0, Math.floor(A.player.health));
sv.energy = Math.max(0, Math.floor(A.player.energy));
A.isRunning = true;
if (A.player.health <= 0) { endArena(false); return; }
render();
startTick();
};
window.endArena = function(victory){
if (A.isRunning === false && A.grid) return; // already ended
A.isRunning=false;
if(A.tickInterval){ clearInterval(A.tickInterval); A.tickInterval=null; }
var sv = SugarCube.State.variables;
sv.arenaSurvivalKills = A.player.kills;
sv.arenaSurvivalHealth = Math.floor(A.player.health);
sv.arenaSurvivalEnergy = Math.floor(A.player.energy);
sv.health = Math.max(0, Math.floor(A.player.health));
sv.energy = Math.max(0, Math.floor(A.player.energy));
log("Arena over!");
if (victory) {
SugarCube.Engine.play("ArenaSurvivalVictory");
} else {
SugarCube.Engine.play("ArenaSurvivalDefeat");
}
};
// Cleanup when leaving the passage
$(document).on(":passageend", function () {
if (!document.getElementById("ar-grid")) {
if (A.tickInterval) {
clearInterval(A.tickInterval);
A.tickInterval = null;
A.isRunning = false;
}
}
});
// On display: either resume existing state or initialise fresh
$(document).on(":passagedisplay", function(){
if (document.getElementById("ar-grid")) {
if (A.grid) {
A.isRunning = true;
render();
startTick();
} else {
initArena();
render();
startTick();
}
}
});
})();
</script>
<!-- ═══ LAYOUT ═══════════════════════════════════════════════════════════════ -->
<<nobr>>
<div style="display:flex;gap:12px;align-items:flex-start;font-family:monospace;">
<div>
<div id="ar-grid"
style="display:grid;grid-template-columns:repeat(12,38px);
gap:1px;background:#111;padding:6px;border:1px solid #333;">
</div>
<div style="display:grid;grid-template-columns:repeat(3,40px);
grid-template-rows:repeat(3,40px);gap:3px;margin-top:8px;">
<div></div>
<button onclick="AR_move(0,-1)"
style="background:#222;color:#fff;border:1px solid #555;cursor:pointer;font-size:18px;">↑</button>
<div></div>
<button onclick="AR_move(-1,0)"
style="background:#222;color:#fff;border:1px solid #555;cursor:pointer;font-size:18px;">←</button>
<div style="background:#333;border:1px solid #444;"></div>
<button onclick="AR_move(1,0)"
style="background:#222;color:#fff;border:1px solid #555;cursor:pointer;font-size:18px;">→</button>
<div></div>
<button onclick="AR_move(0,1)"
style="background:#222;color:#fff;border:1px solid #555;cursor:pointer;font-size:18px;">↓</button>
<div></div>
</div>
<button onclick="AR_technique()"
style="margin-top:8px;width:124px;padding:6px;background:#3a1a3a;
color:#f8f;border:1px solid #a0a;cursor:pointer;font-size:0.85em;">
✨ Technique (15 Energy)
</button>
</div>
<!-- RIGHT: Stats + log -->
<div style="min-width:180px;">
<div style="background:#111;border:1px solid #333;padding:8px;margin-bottom:8px;font-size:0.85em;">
<p style="margin:2px 0;">❤️ Health: <strong id="ar-health">100</strong></p>
<p style="margin:2px 0;">💠 Energy: <strong id="ar-energy">100</strong></p>
<p style="margin:2px 0;">⏱ Time: <strong id="ar-time">180</strong></p>
<p style="margin:2px 0;">⚔ Kills: <strong id="ar-kills">0</strong></p>
<p style="margin:2px 0;">👥 Alive: <strong id="ar-alive">12</strong></p>
<p style="margin:2px 0;">🌀 Zone shrinks in <strong id="ar-shrink">25</strong>s</p>
</div>
<div id="ar-log"
style="background:#0e0e0e;border:1px solid #333;padding:8px;
height:220px;overflow-y:auto;">
</div>
</div>
</div>
<</nobr>>
<</widget>><<set _n to $qteNpc>>
<div style="max-width:520px;margin:0 auto;font-family:Georgia,serif;">
<div style="display:flex;align-items:center;gap:14px;margin-bottom:14px;">
<div style="width:80px;height:80px;background:<<print _n.color>>;border-radius:8px;
display:flex;align-items:center;justify-content:center;font-size:38px;flex-shrink:0;">
<<print _n.icon>>
</div>
<div>
<p style="margin:0;font-size:1.1em;font-weight:bold;"><<print _n.baseName>></p>
<p style="margin:3px 0 0;font-size:0.85em;color:#aaa;"><<print _n.desc>></p>
<p style="margin:4px 0 0;font-size:0.8em;">HP: <strong><<print _n.hp>></strong></p>
</div>
</div>
<div style="background:#0e0e0e;border-left:3px solid <<print _n.color>>;padding:10px 14px;margin-bottom:14px;line-height:1.7;">
<<switch _n.tag>>
<<case "sword_sister">>
<p>She closes the gap in three swift steps, her blade arm sweeping wide — then, deliberately, it's her free hand that reaches you first. Fingers curl around your collar and yank you forward, close enough that her breath hits your cheek. Your backs are against each other; you feel every curve pressing warm and insistent through her torn silk robe.</p>
<p style="color:#ccc;font-size:0.9em;">"I didn't come here just to fight," she murmurs, lips brushing your ear.</p>
<<case "yang_brute">>
<p>He doesn't strike — he <em>grabs</em>. One enormous hand seizes your wrist, the other clamps around your waist and lifts. You're pulled flush against his sweat-slicked chest, his qi radiating like a furnace against your skin. You can feel his heartbeat against you, wild and fast.</p>
<p style="color:#ccc;font-size:0.9em;">"Still want to test me?" he growls, grip tightening.</p>
<<case "fox_spirit">>
<p>She slides behind you with fox-spirit stealth, arms winding around your torso from the back before you can turn. Her claws find the hem of your outer robe and tug it off your shoulder in one smooth motion, baring skin to the arena air. Her chin rests on your shoulder, her breath warm against your neck.</p>
<p style="color:#ccc;font-size:0.9em;">"Got you," she whispers, tail curling around your leg.</p>
<<case "yin_beauty">>
<p>She presses both palms flat to your chest — cold as winter stone — and backs you against an invisible wall of compressed yin qi. The force pins you in place. She steps closer, eyes level with yours, her white hair brushing your face as she leans in to study your reaction.</p>
<p style="color:#ccc;font-size:0.9em;">"You cannot run from cold," she says softly. "And cold always… eventually… burns."</p>
<<case "dual_cult">>
<p>She collides with you shoulder-first, momentum carrying you both sideways. You catch her — instinctively — and end up with one arm around her back, her thigh hooking over your hip as she rights herself. She doesn't pull away. She makes it worse, grabbing your free hand and pressing it to her waist.</p>
<p style="color:#ccc;font-size:0.9em;">"Oh, don't apologise," she laughs breathlessly. "I planned that."</p>
<<case "phantom">>
<p>You never see her move. Suddenly there's a forearm across your throat from behind, pressing — firm but not crushing. Shadow qi bleeds cold into your spine. Her lips graze the back of your neck. Your outer robe's sash is already gone; you don't know when she took it.</p>
<p style="color:#ccc;font-size:0.9em;">"You breathe too loud," she whispers. "I could have done this ten steps ago."</p>
<<case "beast_tamer">>
<p>He tackles you in a full-body impact, and the two of you roll across the arena stone in a tangle of limbs. He ends up on top, knees pinning your thighs, one hand pressing your wrist above your head. His wild eyes search yours — part threat, part something else.</p>
<p style="color:#ccc;font-size:0.9em;">"Beast qi calls to beast qi," he rumbles. "You feel it too."</p>
<<case "thunder_monk">>
<p>Lightning-fast he grabs your forearm; the jolt of his thunder qi makes every hair on your body stand. He reels you in with the hold, spins you, and your back collides with his chest. His robes smell of ozone and incense. A second hand presses firm against your sternum, holding you there.</p>
<p style="color:#ccc;font-size:0.9em;">"The lightning does not lie," he intones. "Nor does this heartbeat."</p>
<<case "poison_lotus">>
<p>She extends one finger and drags it down your forearm — light as a feather, leaving a faint red line where her toxin grazes. Not injected. Just… marked. She circles you slowly, the hem of her qipao whispering against the stone, her eyes never leaving yours.</p>
<p style="color:#ccc;font-size:0.9em;">"I can make it hurt," she murmurs, "or I can make it feel entirely different. Your choice."</p>
<<case "drunk_saint">>
<p>He staggers into you deliberately — you know it's deliberate because the gourd of wine stays perfectly level throughout — and suddenly his arm is slung around your neck, heavy and warm. His face is too close, grinning, flushed. His free hand flicks open your collar button. Just the one. Then he blinks at you innocently.</p>
<p style="color:#ccc;font-size:0.9em;">"Oops," he says, not even slightly sorry.</p>
<<default>>
<p>They close the distance fast, grabbing your arm and twisting you against them. The contact is rough, purposeful — and prolonged.</p>
<</switch>>
<<if _n.firstStrike>>
<p style="color:#ff6666;margin-top:8px;"><em>They struck you before you could react! You're already hurt.</em></p>
<</if>>
</div>
<p style="color:#ffcc00;font-weight:bold;margin-bottom:10px;">⚡ What do you do?</p>
<div style="display:flex;flex-direction:column;gap:8px;">
<<link "⚔️ Break the grip — force them back">>
<<set $qteChoice to "break">>
<<goto "ArenaSurvivalQTEResolution">>
<</link>>
<<link "🤝 Use their closeness — redirect their momentum">>
<<set $qteChoice to "redirect">>
<<goto "ArenaSurvivalQTEResolution">>
<</link>>
<<link "💋 Press closer — turn the contact into your weapon">>
<<set $qteChoice to "intimate">>
<<goto "ArenaSurvivalQTEResolution">>
<</link>>
<<link "🔥 Take control — grab them before they can react">>
<<set $qteChoice to "dominate">>
<<goto "ArenaSurvivalQTEResolution">>
<</link>>
</div>
</div><<set _n to $qteNpc>>
<<set _choice to $qteChoice>>
<div style="max-width:520px;margin:0 auto;font-family:Georgia,serif;">
<<switch _choice>>
<<case "break">>
<h3 style="color:#4af;">⚔️ You wrench free and strike!</h3>
<<switch _n.tag>>
<<case "sword_sister">>
<p>You grab her wrist, twist inward, and shove. Her grip tears away; her sleeve rips at the shoulder with a sharp sound, baring her arm to the elbow. She spins from the momentum and you're on her before she recovers — elbow to her ribs, hard. She hits the dust on one knee, gasping.</p>
<p style="color:#ccc;">"You tore my robe!" she snarls, half-outraged, half something she's fighting not to show.</p>
<<case "yang_brute">>
<p>You plant your feet, drop your weight, and heave upward against his grip. His sash comes loose in your fist; he stumbles back a full step — which for him is a miracle. You follow immediately, driving your shoulder into his gut. Even he grunts at that.</p>
<p style="color:#ccc;">"HA! Now we're talking!" he roars, actually grinning through the pain.</p>
<<case "fox_spirit">>
<p>You spin into the grab, and her own arms tangle around herself. Her outer robe slips off entirely as she's forced to release you — she catches it, but barely, clutching it to her chest as she lands in a crouch, tail frizzed with surprise.</p>
<p style="color:#ccc;">"You BEAST," she hisses, eyes gleaming.</p>
<<case "yin_beauty">>
<p>You channel your qi into your palms and push outward, shattering her yin wall. The cold shatters like glass, and she staggers, frost spreading across her own hands from the rebound. A rare crack runs through her composure.</p>
<p style="color:#ccc;">"Unexpected," she admits, voice tight, cheeks faintly flushed.</p>
<<case "dual_cult">>
<p>You unhook her leg from your hip and step back smartly, leaving her staggering. Her qipao's side-slit tears as she catches herself — she looks down at it, then back up at you, delighted despite herself.</p>
<p style="color:#ccc;">"Oh, you're interesting," she breathes.</p>
<<default>>
<p>You break the hold with sharp, decisive force. They're thrown back, disoriented. You strike while they recover.</p>
<</switch>>
<p style="color:#4ade80;font-weight:bold;margin-top:12px;">✅ Success — heavy damage dealt!</p>
<<run window.AR_qteResult(true)>>
[[Return to Arena->TournamentBattle|FormatSpecific]]
<<case "redirect">>
<h3 style="color:#f0d060;">🤝 You flow with the contact!</h3>
<<switch _n.tag>>
<<case "sword_sister">>
<p>Instead of pushing away you step into her pull, letting her draw you in — then use that momentum to pivot her over your hip. She goes airborne briefly, lands hard. But your hands are still tangled in the remains of her collar, and you come down half on top of her. The landing is not graceful. The closeness is.</p>
<<case "yang_brute">>
<p>You go limp for one heartbeat — his grip expects resistance, gets none. You slide through, use his own yanking motion to swing around his back. Your arm hooks around his thick neck from behind, and you hang off him until he drops to one knee from the choke angle.</p>
<<case "fox_spirit">>
<p>You reach back, grab her arms where they're clasped around you, and use them as a fulcrum — throwing her over your shoulder. She flips neatly, lands on her feet, but her robe didn't quite make the rotation. She catches it, laughing even as she bleeds from a graze on her side.</p>
<<case "yin_beauty">>
<p>You press your palms over her pinning hands and gently push sideways rather than outward. Yin qi redirects. She spins on her own axis, confused, and you step smoothly behind her, one arm across her collarbone, holding her from the back until she stills.</p>
<p style="color:#ccc;">"Let go," she whispers, but doesn't activate her qi to enforce it.</p>
<<case "beast_tamer">>
<p>You don't fight the pin — you bridge your hips upward, roll, and suddenly the top-bottom is reversed. You're kneeling over him now. He blinks up at you, chest heaving. Then he starts to smile.</p>
<<default>>
<p>You redirect their energy back on them, using their own momentum to land a clean, efficient strike. They reel, disoriented.</p>
<</switch>>
<p style="color:#ffd700;font-weight:bold;margin-top:12px;">✅ Partial success — moderate damage, advantageous position!</p>
<<run window.AR_qteResult(true)>>
[[Return to Arena->TournamentBattle|FormatSpecific]]
<<case "intimate">>
<h3 style="color:#ff69b4;">💋 You lean in...</h3>
<<switch _n.tag>>
<<case "sword_sister">>
<p>You don't pull away from her grip on your collar. You step into it, deliberately closing the last inch. Your free hand settles on her hip, and you hold her gaze. For one suspended moment she forgets to swing. Her lips part. Your knee finds her inner thigh and sweeps her footing away.</p>
<p style="color:#ccc;">She hits the ground looking dazed and flushed and furious in equal measure.</p>
<<case "yang_brute">>
<p>You go still in his crushing grip — then tilt your head back against his chest and look up at him. "Not yet," you say quietly. The contradiction in his eyes is immediate: the fighter not knowing what to do with the lack of struggle. His hold loosens by one fraction. Your elbow drives back into his solar plexus.</p>
<<case "fox_spirit">>
<p>You reach up and cover her hand — the one clutching your bared shoulder — with yours, pressing it there. She freezes, sensing a trap but not finding it. You turn just enough to meet her eyes, less than a handspan between your faces. "Your move," you murmur. She bites her lip instead of attacking.</p>
<p>That one-second lapse costs her. Your knee rises sharply into her guard.</p>
<<case "phantom">>
<p>You don't fight the forearm at your throat. You tuck your chin, turn your head, and press your cheek against her arm — holding it there, warm and deliberate. Behind you, you feel her breath catch. The cold shadow-qi stutter. Your foot hooks around her ankle.</p>
<<case "poison_lotus">>
<p>You catch her circling wrist and bring the marked line on your forearm to your lips, eyes on hers. The toxin is superficial — you knew that. She didn't expect you to know. For one extraordinary moment her practiced poise evaporates entirely, and she stares at you with wide, unguarded eyes.</p>
<p>You strike into that gap without hesitation.</p>
<<default>>
<p>You press closer instead of retreating. The unexpected intimacy disrupts their rhythm entirely — the opening you need materialises, and you take it cleanly.</p>
<</switch>>
<p style="color:#ff69b4;font-weight:bold;margin-top:12px;">✅ Success — distraction creates a critical opening!</p>
<<run window.AR_qteResult(true)>>
[[Return to Arena->TournamentBattle|FormatSpecific]]
<<case "dominate">>
<h3 style="color:#ff4444;">🔥 You seize control!</h3>
<<switch _n.tag>>
<<case "sword_sister">>
<p>You grab both her wrists before she can reset her stance, cross them at her chest, and back her against the arena wall. Pinned. Her sword arm is useless at this angle. She looks up at you — breathing hard, lips pressed together, a flush spreading down her neck and past her torn collar.</p>
<p style="color:#ccc;">"Yield," you say.</p>
<p style="color:#ccc;">She doesn't. But it takes her two full seconds to remember why.</p>
<<case "yang_brute">>
<p>You break grip, grab his sash with both hands, and use every ounce of your qi to swing him sideways into the arena stone. The impact reverberates. He slumps to one knee, massive frame shuddering, looking up at you with something that has left "fury" far behind and arrived somewhere rawer.</p>
<p style="color:#ccc;">"You're the first one who's done that to me," he says roughly. "…In a long time."</p>
<<case "fox_spirit">>
<p>You spin her, pin her back against you — arm across her stomach, your grip iron — and growl low: "Stop." Her struggling freezes instantly, every muscle going taut and then, inexplicably, soft. Her ears fold. Her tail curls inward. She makes a very small sound.</p>
<p style="color:#ccc;">"This," she whispers, "is deeply unfair."</p>
<<case "yin_beauty">>
<p>You shatter the rest of her yin wall not with brute force but with focused heat — your palm pressed flat to her sternum, qi burning warm and insistent against her cold. The frost on her skin melts where you touch. She goes absolutely still, eyes wide, the composure she has carried all her life dissolving in your hands.</p>
<p style="color:#ccc;">Her next breath is shaking. "How," she says, "did you break my cold?"</p>
<<case "beast_tamer">>
<p>You seize the fur trim of his collar and drag him down to your eye level. "Enough." He freezes — beast tamer, unaccustomed to being subdued — and something old and instinctual in him responds to the dominance the way any creature would. He stills completely, watching you.</p>
<p style="color:#ccc;">"…Alpha," he says simply, after a long moment.</p>
<<case "drunk_saint">>
<p>You pluck the gourd from his hand — the one thing he'll always track. He follows it instinctively and walks straight into you. You catch him, press his back to your front, and close your hand around his sword wrist. The drunken sway goes rigid with surprise. For once, he has absolutely nothing to say.</p>
<<default>>
<p>You take charge before they can recalibrate — grabbing, gripping, forcing them to react to you instead. The sudden reversal of control staggers them completely.</p>
<</switch>>
<p style="color:#ff4444;font-weight:bold;margin-top:12px;">💥 Critical success — massive damage, total momentary dominance!</p>
<<run window.AR_qteResult(true)>>
[[Return to Arena->TournamentBattle|FormatSpecific]]
<</switch>>
</div><<set _kills to $arenaSurvivalKills ?? 0>>
<<set _health to $arenaSurvivalHealth ?? 0>>
<<getArenaSurvivalVictory>>
<p>The last opponent falls and the crowd erupts. Dust and spent qi hang in the air.</p>
<p>You stand alone amidst the fallen, breathing hard. Your robes are torn, your body battered — but you are victorious.</p>
<p style="color:#ffd700;">Enemies defeated: <strong><<print _kills>></strong></p>
<p style="color:#4ade80;">Health remaining: <strong><<print _health>></strong></p>
<p>The tournament officials approach with your prize — a jade token of survival, and the adoration of every onlooker.</p>
<<link "Celebrate Your Victory" $city>>
<<set $pe to 0>>
<</link>><<set _kills to $arenaSurvivalKills ?? 0>>
<<getArenaSurvivalDefeat>>
<<if $health lte 0>>
<p>A final blow sends you crashing to the stone floor. Your vision swims and the roar of the crowd fades to a distant murmur.</p>
<<else>>
<p>The horn sounds — time has run out. You are surrounded by enemies still standing, and the marshals pull you from the arena floor.</p>
<</if>>
<p>You wake in the medical tent, bandaged and sore. At least you are alive… but the shame burns hotter than any wound.</p>
<p style="color:#aaa;">You managed to eliminate <<print _kills>> opponents before falling.</p>
<<link "I will come back next time... stronger.." $city>>
<<set $pe to 0>>
<</link>><<widget "HeavenlyStairChallenge">>
<<nobr>>
<<silently>>
<<if !$hsPhase>>
<<set $hsPhase to "pre">>
<<set $hsPreNPCs to []>>
<<set $hsPostNPCs to []>>
<<set $hsPlayerStep to 0>>
<<set $hsCurrentStep to 1>>
<<set $hsPlayerActive to false>>
<<set _preCount to random(4,6)>>
<<for _i to 0; _i lt _preCount; _i++>>
<<set _name to ["Iron Body Lu","Swift Sword Mei","Azure Pill Elder","Shadow Step Fang","Crimson Mantis","Jade Grace","Thunder Hand Wei","Silent Viper"].random() + " (Rank "+(_i+1)+")">>
<<set _steps to random(12, 38)>>
<<set $hsPreNPCs.push({name: _name, steps: _steps})>>
<</for>>
<<set $hsPreNPCs.sort(function(a,b){ return b.steps - a.steps; })>>
<</if>>
<</silently>>
<div style="max-width:600px;margin:0 auto;font-family:Georgia,serif;">
<h2>🏔️ Heavenly Stair Challenge</h2>
<p>An ancient formation manifests a staircase reaching toward the heavens. Each step places greater pressure upon the body, mind, and soul.</p>
<<if $hsPhase eq "pre">>
<h3>Earlier Climbers</h3>
<<if $hsPreNPCs.length>>
<ol>
<<for _npc range $hsPreNPCs>>
<li><strong><<print _npc.name>></strong> — <<print _npc.steps>> steps</li>
<</for>>
</ol>
<<else>>
<p>No one has dared to climb before you.</p>
<</if>>
<p style="margin-top:1.5em;">The current highest is <strong><<print Math.max.apply(null, $hsPreNPCs.map(function(n){return n.steps;}).concat(0))>></strong> steps.</p>
<<link "🦶 Begin Your Ascent">>
<<set $hsPhase to "climb">>
<<set $hsPlayerActive to true>>
<<set $hsCurrentStep to 1>>
<<set $health to $health>>
<<set $energy to $energy>>
<<goto "HeavenlyStairStep">>
<</link>>
<<elseif $hsPhase eq "results">>
<<goto "HeavenlyStairResults">>
<</if>>
</div>
<</nobr>>
<</widget>><<silently>>
<<set _step to $hsCurrentStep>>
<<set _diff to Math.floor(_step * 1.6) + random(-3,3)>>
<<set $hsCurrentDiff to _diff>> <!-- store for resolver -->
<<set _challengeType to ["body","mind","soul"].random()>>
<<set _health to $health>>
<<set _energy to $energy>>
<</silently>>
<div style="max-width:550px;margin:0 auto;font-family:Georgia,serif;">
<h2>Step <<print _step>></h2>
<<if _challengeType eq "body">>
<p>The air thickens into a crushing weight, pressing down on your shoulders. Your muscles scream as gravity multiplies – it feels like carrying a mountain on your back.</p>
<<elseif _challengeType eq "mind">>
<p>A thousand whispers assault your concentration. Visions of past failures, future doubts, and hidden fears swirl around you like an invisible storm. Your mind trembles on the edge of chaos.</p>
<<elseif _challengeType eq "soul">>
<p>Your very essence quivers under the celestial weight. The staircase seems to pierce your dantian, probing your spirit with an ancient, indifferent force. Your soul feels naked before the heavens.</p>
<</if>>
<p><strong>Difficulty:</strong> <<print _diff>></p>
<p>❤️ Health: <<print _health>> | 💠 Energy: <<print _energy>></p>
<<if _health <= 0 or _energy <= 0>>
<p style="color:#ff4444;">Your body fails you. You collapse on step <<print _step>>, unable to continue.</p>
<<set $hsPlayerStep to _step - 1>>
<<set $hsPhase to "post">>
<<set $hsPlayerActive to false>>
<<set $health to Math.max(0, _health)>>
<<set $energy to Math.max(0, _energy)>>
<<goto "HeavenlyStairResults">>
<</if>>
<p>How do you endure?</p>
<div style="display:flex;flex-direction:column;gap:8px;">
<<link "💪 Body (Martial Arts)">>
<<set $hsChosenStat to "body">>
<<goto "HeavenlyStairStepResolver">>
<</link>>
<<link "🧠 Mind (Willpower)">>
<<set $hsChosenStat to "mind">>
<<goto "HeavenlyStairStepResolver">>
<</link>>
<<link "✨ Soul (Spiritual Root)">>
<<set $hsChosenStat to "soul">>
<<goto "HeavenlyStairStepResolver">>
<</link>>
</div>
<p style="margin-top:1.5em;">
<<link "⚠️ Voluntarily Stop Climbing">>
<<set $hsPlayerStep to $hsCurrentStep - 1>>
<<set $hsPhase to "post">>
<<set $hsPlayerActive to false>>
<<set $health to Math.max(0, $health)>>
<<set $energy to Math.max(0, $energy)>>
<<goto "HeavenlyStairResults">>
<</link>>
</p>
</div><<silently>>
<<set _step to $hsCurrentStep>>
<<set _diff to $hsCurrentDiff>>
<<set _stat to 0>>
<<if $hsChosenStat eq "body">>
<<set _stat to $martialArts>>
<<elseif $hsChosenStat eq "mind">>
<<set _stat to $willpower>>
<<elseif $hsChosenStat eq "soul">>
<<set _stat to $spiritualRoot>>
<</if>>
<<if _stat >= _diff>>
<<set $health -= 5 + Math.floor(_step/5)>>
<<set $energy -= 3>>
<<set $hsCurrentStep += 1>>
<<set _message to "success">>
<<else>>
<<set $health -= 10 + Math.floor(_step/3)>>
<<set $energy -= 5>>
<<set _message to "failure">>
<</if>>
<</silently>>
<div style="max-width:550px;margin:0 auto;font-family:Georgia,serif;">
<<if _message eq "success">>
<<if $hsChosenStat eq "body">>
<p style="color:#4ade80;">You power through with sheer physical might!</p>
<<elseif $hsChosenStat eq "mind">>
<p style="color:#4ade80;">Your iron focus silences the chaos.</p>
<<else>>
<p style="color:#4ade80;">Your soul harmonises with the stair's rhythm.</p>
<</if>>
<<else>>
<<if $hsChosenStat eq "body">>
<p style="color:#f88;">Your body gives way under the strain.</p>
<<elseif $hsChosenStat eq "mind">>
<p style="color:#f88;">Your mind fractures under the assault.</p>
<<else>>
<p style="color:#f88;">Your spirit trembles on the edge of dissolution.</p>
<</if>>
<</if>>
<<if $health <= 0 or $energy <= 0>>
<p style="color:#ff4444;">You cannot go on. You collapse on the stairs.</p>
<<set $hsPlayerStep to $hsCurrentStep - 1>>
<<set $hsPhase to "post">>
<<set $hsPlayerActive to false>>
<<set $health to Math.max(0, $health)>>
<<set $energy to Math.max(0, $energy)>>
<<goto "HeavenlyStairResults">>
<<else>>
<<link "Next Step">>
<<goto "HeavenlyStairStep">>
<</link>>
<</if>>
</div><<silently>>
/* Generate post‑climbers (2‑4 NPCs) */
<<set _postCount to random(2,4)>>
<<set $hsPostNPCs to []>>
<<for _i to 0; _i lt _postCount; _i++>>
<<set _name to ["Golden Lion Peng","Silent Reaper Xu","Jade Serpent Li","Cyclone Kick Bao","Void Disciple","Blade Devil","Frozen Petal"].random() + " (Finalist)">>
<<set _steps to random(10, 40)>>
<<set $hsPostNPCs.push({name: _name, steps: _steps})>>
<</for>>
/* Combine all climbers for ranking */
<<set _all to []>>
<<for _npc range $hsPreNPCs>>
<<set _all.push(_npc)>>
<</for>>
<<set _all.push({name: "You", steps: $hsPlayerStep})>>
<<for _npc range $hsPostNPCs>>
<<set _all.push(_npc)>>
<</for>>
<<set _all.sort(function(a,b){ return b.steps - a.steps; })>>
<<set $hsPlayerRank to _all.findIndex(function(e){ return e.name === "You"; }) + 1>>
<<set $hsTotalClimbers to _all.length>>
<</silently>>
<div style="max-width:600px;margin:0 auto;font-family:Georgia,serif;">
<<if $hsPlayerRank eq 1>>
<<getHeavenlyStairVictory>>
<<else>>
<<getHeavenlyStairDefeat>>
<</if>>
<h3>Final Rankings</h3>
<ol>
<<for _entry range _all>>
<li><strong><<print _entry.name>></strong>: <<print _entry.steps>> steps<<if _entry.name eq "You">> ⬅️ You<</if>></li>
<</for>>
</ol>
<<link "Return to Tournament" $city>>
<<set $hsPhase to undefined>>
<<set $hsPreNPCs to undefined>>
<<set $hsPostNPCs to undefined>>
<<set $hsPlayerStep to undefined>>
<</link>>
</div><<widget "PillRefiningTournament">>
<<nobr>>
<<silently>>
<<if !$prPhase>>
<<set $prPhase to "pre">>
<<set $prPhaseStep to 1>>
<<set $prScore to 0>>
<<set $prNPCs to []>>
/* Generate 5-8 NPC competitors with random scores */
<<set _npcCount to random(5,8)>>
<<for _i to 0; _i lt _npcCount; _i++>>
<<set _name to ["Azure Pill Elder","Crimson Cauldron Li","Jade Elixir Fairy","Iron Furnace Zhou","Silent Alchemist Wei","Poison Mistress Xue","Golden Pill Monk","Herb Sage Fang"].random() + " (Rank "+(_i+1)+")">>
<<set _score to random(40, 95)>>
<<set $prNPCs.push({name: _name, score: _score})>>
<</for>>
<<set $prNPCs.sort(function(a,b){ return b.score - a.score; })>>
<</if>>
<</silently>>
<div style="max-width:600px;margin:0 auto;font-family:Georgia,serif;">
<h2>⚗️ Pill Refining Tournament</h2>
<p>A row of ancient cauldrons lines the hall. Each competitor must refine a <strong>Spirit Ascension Pill</strong> – the highest quality wins.</p>
<<if $prPhase eq "pre">>
<h3>Registered Alchemists</h3>
<<if $prNPCs.length>>
<ol>
<<for _npc range $prNPCs>>
<li><strong><<print _npc.name>></strong> – estimated skill: <<print _npc.score>></li>
<</for>>
</ol>
<<else>>
<p>No other alchemists registered – you refine unopposed.</p>
<</if>>
<p style="margin-top:1.5em;">You will be judged on your pill's quality. Begin when ready.</p>
<<link "🔥 Light the Cauldron">>
<<set $prPhase to "refine">>
<<set $prPhaseStep to 1>>
<<goto "PillRefiningPhase">>
<</link>>
<<elseif $prPhase eq "results">>
<<goto "PillRefiningResults">>
<</if>>
</div>
<</nobr>>
<</widget>><<silently>>
<<set _step to $prPhaseStep>>
<<set _difficulty to 10 + (_step * 8) + random(-3,3)>>
<<if _step eq 1>>
<<set _title to "Ingredient Preparation">>
<<set _desc to "You must select and process the spirit herbs. One wrong cut and the entire batch is ruined.">>
<<elseif _step eq 2>>
<<set _title to "Flame Control">>
<<set _desc to "The cauldron roars. You must balance the fire – too hot and the essence burns, too cold and it fails to fuse.">>
<<elseif _step eq 3>>
<<set _title to "Pill Condensation">>
<<set _desc to "The final moment. The liquid coalesces into a pill. One mistake now and all previous effort is wasted.">>
<</if>>
<</silently>>
<div style="max-width:550px;margin:0 auto;font-family:Georgia,serif;">
<h2>Phase <<print _step>>: <<print _title>></h2>
<p><<print _desc>></p>
<p><strong>Difficulty:</strong> <<print _difficulty>></p>
<p>How will you proceed?</p>
<div style="display:flex;flex-direction:column;gap:8px;">
<<link "🌿 Spiritual Root – sense the ingredients">>
<<set $prChosenStat to "spiritual">>
<<goto "PillRefiningPhaseResolver">>
<</link>>
<<link "📖 Insight – recall ancient formulas">>
<<set $prChosenStat to "insight">>
<<goto "PillRefiningPhaseResolver">>
<</link>>
<<link "🍀 Luck – trust your instincts">>
<<set $prChosenStat to "luck">>
<<goto "PillRefiningPhaseResolver">>
<</link>>
</div>
</div><<silently>>
<<set _step to $prPhaseStep>>
<<set _difficulty to 10 + (_step * 8) + random(-3,3)>>
<<set _stat to 0>>
<<if $prChosenStat eq "spiritual">>
<<set _stat to $spiritualRoot>>
<<set _statName to "Spiritual Root">>
<<elseif $prChosenStat eq "insight">>
<<set _stat to $insight>>
<<set _statName to "Insight">>
<<elseif $prChosenStat eq "luck">>
<<set _stat to $luck>>
<<set _statName to "Luck">>
<</if>>
<<if _stat >= _difficulty>>
<<set _success to true>>
<<set _phaseScore to 25 + random(0,8)>>
<<set _message to "success">>
<<else>>
<<set _success to false>>
<<set _phaseScore to 10 + random(0,5)>>
<<set _message to "failure">>
<</if>>
<<set $prScore += _phaseScore>>
<</silently>>
<div style="max-width:550px;margin:0 auto;font-family:Georgia,serif;">
<<if _message eq "success">>
<<if $prChosenStat eq "spiritual">>
<p style="color:#4ade80;">Your spiritual senses guide your hands perfectly. The herbs practically leap into the cauldron in the right order.</p>
<<elseif $prChosenStat eq "insight">>
<p style="color:#4ade80;">You recall an ancient scroll. A slight modification to the formula at this stage – brilliant!</p>
<<else>>
<p style="color:#4ade80;">Against all odds, a gamble pays off. The flames dance exactly as you need them to.</p>
<</if>>
<p>You gain <strong><<print _phaseScore>></strong> quality points. (Total: <<print $prScore>>)</p>
<<else>>
<<if $prChosenStat eq "spiritual">>
<p style="color:#f88;">Your spiritual senses waver. You misjudge the herb ratios – the mixture bubbles dangerously.</p>
<<elseif $prChosenStat eq "insight">>
<p style="color:#f88;">A memory lapse. The formula you were certain of turns out incomplete. You barely salvage the step.</p>
<<else>>
<p style="color:#f88;">Your gamble fails. The cauldron shudders and almost cracks, wasting precious essence.</p>
<</if>>
<p>You only add <strong><<print _phaseScore>></strong> quality points. (Total: <<print $prScore>>)</p>
<</if>>
<<set $prPhaseStep += 1>>
<<if $prPhaseStep gt 3>>
<<set $prPhase to "results">>
<<goto "PillRefiningResults">>
<<else>>
<<link "Next Phase">>
<<goto "PillRefiningPhase">>
<</link>>
<</if>>
</div><<silently>>
/* Combine player and NPC scores */
<<set _all to []>>
<<for _npc range $prNPCs>>
<<set _all.push(_npc)>>
<</for>>
<<set _all.push({name: "You", score: $prScore})>>
<<set _all.sort(function(a,b){ return b.score - a.score; })>>
<<set $prPlayerRank to _all.findIndex(function(e){ return e.name === "You"; }) + 1>>
<<set $prTotal to _all.length>>
<</silently>>
<div style="max-width:600px;margin:0 auto;font-family:Georgia,serif;">
<<if $prPlayerRank eq 1>>
<<getPillRefiningVictory>>
<<else>>
<<getPillRefiningDefeat>>
<</if>>
<h3>Final Rankings</h3>
<ol>
<<for _entry range _all>>
<li><strong><<print _entry.name>></strong>: <<print _entry.score>> points<<if _entry.name eq "You">> ⬅️ You<</if>></li>
<</for>>
</ol>
<<link "Return to Tournament" $city>>
<<set $prPhase to undefined>>
<<set $prNPCs to undefined>>
<<set $prScore to undefined>>
<<set $prPlayerRank to undefined>>
<<set $prTotal to undefined>>
<</link>>
</div><<widget "generateTeamAllies">>
<<set $allyTeam to []>>
<<if !$teamAlly1>>
<<applyDifficultyScaling $tournamentData.round>>
<<CreateNPC001>>
<<set $teamAlly1 to _npc>>
<<set $allyTeam.push($teamAlly1)>>
<</if>>
<<if !$teamAlly2>>
<<applyDifficultyScaling $tournamentData.round>>
<<CreateNPC001>>
<<set $teamAlly2 to _npc>>
<<set $allyTeam.push($teamAlly2)>>
<</if>>
<<if !$teamAlly3>>
<<applyDifficultyScaling $tournamentData.round>>
<<CreateNPC001>>
<<set $teamAlly3 to _npc>>
<<set $allyTeam.push($teamAlly3)>>
<</if>>
<</widget>>
<<widget "generateTeamEnemies">>
<<set $enemyTeam to []>>
<<if !$enemyAlly1>>
<<applyDifficultyScaling $tournamentData.round>>
<<CreateNPC001>>
<<set $enemyAlly1 to _npc>>
<<set $enemyTeam.push($enemyAlly1)>>
<</if>>
<<if !$enemyAlly2>>
<<applyDifficultyScaling $tournamentData.round>>
<<CreateNPC001>>
<<set $enemyAlly2 to _npc>>
<<set $enemyTeam.push($enemyAlly2)>>
<</if>>
<<if !$enemyAlly3>>
<<applyDifficultyScaling $tournamentData.round>>
<<CreateNPC001>>
<<set $enemyAlly3 to _npc>>
<<set $enemyTeam.push($enemyAlly3)>>
<</if>>
<<if !$enemyAlly4>>
<<applyDifficultyScaling $tournamentData.round>>
<<CreateNPC001>>
<<set $enemyAlly4 to _npc>>
<<set $enemyTeam.push($enemyAlly4)>>
<</if>>
<</widget>><<widget "TournamentMartialElimination">>
<<if !$pe or $pe eq 0>>
<div class="tournament-battle">
<h2>⚔️ <<print _format>> Battle</h2>
<img src="images/Story/arena.png" class="center" width="600">
</div>
<div style="text-align: center; margin-top: 15px; border-top: 1px solid #444; padding-top: 10px;">
<span style="font-size: 0.9em; letter-spacing: 2px; color: #aaa;">CURRENT BRACKET</span><br>
<span style="font-size: 1.5em; font-weight: bold; color: #daa520;">
<<if $tournamentData.round eq 1>>PRELIMINARY STAGE
<<elseif $tournamentData.round eq 2>>ROUND OF 16
<<elseif $tournamentData.round eq 3>>QUARTER-FINALS (TOP 8)
<<elseif $tournamentData.round eq 4>>SEMI-FINALS (TOP 4)
<<elseif $tournamentData.round eq 5>>CHAMPIONSHIP MATCH
<</if>>
</span>
</div>
<<generateSingleEliminationOpponent>>
<p>Your first opponent steps into the arena. This is the preliminary round.</p>
<<BeforeBattle>>
<<link "⚔️ Begin Duel" "TournamentBattle:Martial Elimination">>
<<set $nextPe to 1>><<set $pe to 0>><<set $actionsLeft to 3>>
<</link>>
<br><<elseif $pe eq 6>>
<div style="text-align: center; margin-top: 15px; border-top: 1px solid #444; padding-top: 10px;">
<span style="font-size: 0.9em; letter-spacing: 2px; color: #aaa;">YOU'VE WON THE CHAMPIONSHIP!</span><br>
<span style="font-size: 1.5em; font-weight: bold; color: #daa520;">
</span>
</div>
<<getMartialEliminationVictory>>
<<link "Celebrate Your Victory" $city>>
<<set $pe to 0>>
<<set $tournamentData to null>>
<<set $tournamentHost to null>>
<</link>>
<<elseif $pe eq "lost">>
<div style="text-align: center; margin-top: 15px; border-top: 1px solid #444; padding-top: 10px;">
<span style="font-size: 0.9em; letter-spacing: 2px; color: #aaa;">YOU'VE LOST AT <<if $tournamentData.round eq 0>>PRELIMINARY STAGE
<<elseif $tournamentData.round eq 2>>ROUND OF 16
<<elseif $tournamentData.round eq 3>>QUARTER-FINALS (TOP 8)
<<elseif $tournamentData.round eq 4>>SEMI-FINALS (TOP 4)
<<elseif $tournamentData.round eq 5>>CHAMPIONSHIP MATCH
<</if>>!</span><br>
<span style="font-size: 1.5em; font-weight: bold; color: #daa520;">
</span>
</div>
<<getMartialEliminationDefeat $tournamentData.round>>
<<link "I will come back... stronger..." $city>>
<<set $pe to 0>>
<<set $tournamentData to null>>
<<set $tournamentHost to null>>
<</link>>
<<else>>
<p>You recover between rounds, your body aching but your spirit high.</p>
<<if $actionsLeft gt 0>>
<<link "Rest" "TournamentBattle|FormatSpecific">><<set $health to Math.min($health + 0.3 * $maxhealth, $maxhealth)>><<set $actionsLeft -= 1>>
<</link>>
<</if>>
<<generateSingleEliminationOpponent>>
<<BeforeBattle>>
<br><<link "⚔️ Face Next Opponent" "TournamentBattle:Martial Elimination">>
<<set $pe to 0>>
<<set $actionsLeft to 3>>
<</link>>
<br><<linkappend "Observe other battles">>
<<set _watchfight to random(1,3)>>
<<if _watchfight eq 1>>
<p>Two unfamiliar cultivators clash in a blur of movement. One conjures spears of flame, the other counters with a spinning jade barrier. In moments, the match ends — a clean strike to the chest, a cloud of dust, and silence.</p>
<<elseif _watchfight eq 2>>
<p>You watch as a towering man swings a massive blade, each strike causing tremors. His opponent dances like a shadow, evading each blow — until one misstep seals their fate. The match is over in an instant.</p>
<<else>>
<p>Two elegant female cultivators duel mid-air. Petals and frost swirl around them as techniques collide. One miscalculates her descent, crashing into the stone — and the battle ends with a respectful bow.</p>
<</if>>
<</linkappend>>
<<if $actionsLeft gt 0 and $health lt $maxhealth>>
<br><<linkappend "Buy recovery potion">>
<p>You stagger slightly as you return to the waiting area. Your body aches, blood still trickling from wounds earned in the last fight.</p>
<p>A shady vendor with a crooked smile eyes you knowingly. His stall is cluttered with glowing vials.</p>
<span class="male">“You look like hell warmed over. Lucky for you, I sell miracles in bottles.”</span>
He uncorks a flask — sweet, sharp qi wafts toward you.
<span class="male">“Hmmm.... it will be 150 spirit stones. It'll patch you up before the next round. Interested?”</span>
<<if $gold gte 150>>
<<linkappend "Buy healing potion">>
<<set $health to $maxhealth>>
<<set $energy to $maxenergy>>
<<set $gold -= 150>>
<p>You slap the coins into his palm. He grins and hands over the vial.</p>
<p><span class="male">“Pleasure doing business.”</span></p>
<p>You down the potion in one go. Warmth floods your limbs, wounds knitting closed. Strength returns.</p>
<</linkappend>>
<<else>>
<p>Your coin pouch is nearly empty.</p>
<p>The shopkeeper hums, amused. <span class="male">“No gold? Then maybe you'd be willing to... negotiate.”</span></p>
<p>He steps closer, eyes roaming shamelessly. <span class="male">“My potions are potent — surely worth a few moans?”</span></p>
<<if $corruption gte 20>>
<<link "Give in to his offer" "Tournament|MerchantSex">>
<<set $sexCumcount to 0, $sexPosition to "", $sexFinished to false>>
<<set $tournamentpassage to passage()>>
<<set $scene to 0>>
<</link>>
<</if>>
<<linkappend "Refuse and fight injured">>
<p>You shake your head. You’ll face the next battle bloodied but unbroken.</p>
<p>The shopkeeper shrugs. <span class="male">“Suit yourself. Just don’t die out there. I hate cleaning up corpses.”</span></p>
<</linkappend>>
<</if>>
<</linkappend>>
<</if>> <</if>>
<</widget>>
<!- ═════════════════════════════════════════════════════════════
ARENA TEAM TOURNAMENT
═════════════════════════════════════════════════════════════ -->
<<widget "TournamentTeamElimination">>
<<if !$pe or $pe eq 0>>
<div class="tournament-battle">
<h2>⚔️ <<print _format>> Battle</h2>
<img src="images/Story/arena.png" class="center" width="600">
</div>
<div style="text-align: center; margin-top: 15px; border-top: 1px solid #444; padding-top: 10px;">
<span style="font-size: 0.9em; letter-spacing: 2px; color: #aaa;">CURRENT BRACKET</span><br>
<span style="font-size: 1.5em; font-weight: bold; color: #daa520;">
<<if $tournamentData.round eq 1>>PRELIMINARY STAGE
<<elseif $tournamentData.round eq 2>>ROUND OF 16
<<elseif $tournamentData.round eq 3>>QUARTER-FINALS (TOP 8)
<<elseif $tournamentData.round eq 4>>SEMI-FINALS (TOP 4)
<<elseif $tournamentData.round eq 5>>CHAMPIONSHIP MATCH
<</if>>
</span>
</div>
<<generateTeamAllies>>
<<generateTeamEnemies>>
<p>Your team steps into the arena. <strong>3 allies</strong> stand with you against <strong>4 opponents</strong>.</p>
<<TeamBeforeBattle>>
<<link "⚔️ Begin Team Fight" "TournamentBattle:Team Elimination">>
<<set $nextPe to 1>><<set $pe to 0>><<set $actionsLeft to 3>>
<</link>>
<<elseif $pe eq 6>>
<div style="text-align: center; margin-top: 15px; border-top: 1px solid #444; padding-top: 10px;">
<span style="font-size: 0.9em; letter-spacing: 2px; color: #aaa;">YOU'VE WON THE CHAMPIONSHIP!</span><br>
<span style="font-size: 1.5em; font-weight: bold; color: #daa520;">
</span>
</div>
<<getTeamTournamentVictory>>
<<link "Celebrate Your Victory" $city>>
<<set $pe to 0>>
<<set $tournamentData to null>>
<<set $tournamentHost to null>>
<</link>>
<<elseif $pe eq "lost">>
<div style="text-align: center; margin-top: 15px; border-top: 1px solid #444; padding-top: 10px;">
<span style="font-size: 0.9em; letter-spacing: 2px; color: #aaa;">YOUR TEAM HAS BEEN DEFEATED AT
<<if $tournamentData.round eq 0>>PRELIMINARY STAGE
<<elseif $tournamentData.round eq 2>>ROUND OF 16
<<elseif $tournamentData.round eq 3>>QUARTER-FINALS (TOP 8)
<<elseif $tournamentData.round eq 4>>SEMI-FINALS (TOP 4)
<<elseif $tournamentData.round eq 5>>CHAMPIONSHIP MATCH
<</if>>!</span><br>
<span style="font-size: 1.5em; font-weight: bold; color: #daa520;">
</span>
</div>
<<getTeamTournamentDefeat $tournamentData.round>>
<<set $pe to 0>>
<<set $tournamentData to null>>
<<set $tournamentHost to null>>
<<link "Leave the arena" $city>><</link>>
<<else>>
<div class="tournament-battle">
<h2>⚔️ <<print _format>> Battle</h2>
<img src="images/Story/arena.png" class="center" width="600">
</div>
<div style="text-align: center; margin-top: 15px; border-top: 1px solid #444; padding-top: 10px;">
<span style="font-size: 0.9em; letter-spacing: 2px; color: #aaa;">CURRENT BRACKET</span><br>
<span style="font-size: 1.5em; font-weight: bold; color: #daa520;">
<<if $tournamentData.round eq 1>>PRELIMINARY STAGE
<<elseif $tournamentData.round eq 2>>ROUND OF 16
<<elseif $tournamentData.round eq 3>>QUARTER-FINALS (TOP 8)
<<elseif $tournamentData.round eq 4>>SEMI-FINALS (TOP 4)
<<elseif $tournamentData.round eq 5>>CHAMPIONSHIP MATCH
<</if>>
</span>
</div>
<p>Your team regroups and prepares for the next round.</p>
<<if $actionsLeft gt 0>>
<<link "Rest (Recover Health & Energy)" "TournamentBattle|FormatSpecific">>
<<set $health to Math.min($health + 0.3 * $maxhealth, $maxhealth)>>
<<set $energy to Math.min($energy + 0.3 * $maxenergy, $maxenergy)>>
<<for _ally range $allyTeam>>
<!-- Heal Health by 30% without exceeding Max Health -->
<<set _ally.NPCcurrenthealth to Math.min(_ally.NPCcurrenthealth + (0.3 * _ally.NPCmaxhealth), _ally.NPCmaxhealth)>>
<!-- Restore Energy by 30% without exceeding Max Energy -->
<<set _ally.NPCenergy to Math.min(_ally.NPCenergy + (0.3 * _ally.NPCmaxenergy), _ally.NPCmaxenergy)>>
<</for>>
<<set $actionsLeft -= 1>>
<p>You and your teammates tend wounds and recover some strength.</p>
<</link>>
<</if>>
<br><<link "⚔️ Face Next Opposing Team" "TournamentBattle:Team Elimination">>
<<generateTeamEnemies>>
<<TeamBeforeBattle>>
<<set $pe to 0>>
<<set $actionsLeft to 3>>
<</link>>
/* Observe other battles, potion vendor, etc. (same as before) */
<br><<linkappend "Observe other battles">>
<<set _watchfight to random(1,3)>>
<<if _watchfight eq 1>>
<p>Two teams clash in a frantic exchange. One side’s formation crumbles after a coordinated strike.</p>
<<elseif _watchfight eq 2>>
<p>A lone cultivator on a losing team makes a heroic last stand, but is eventually overwhelmed.</p>
<<else>>
<p>You witness a perfectly executed pincer movement – a team of four moving as one. Impressive.</p>
<</if>>
<</linkappend>>
<<if $actionsLeft gt 0 and $health lt $maxhealth>>
<br><<linkappend "Buy recovery potion">>
<p>You stagger slightly as you return to the waiting area. Your body aches, blood still trickling from wounds earned in the last fight.</p>
<p>A shady vendor with a crooked smile eyes you knowingly. His stall is cluttered with glowing vials.</p>
<span class="male">“You look like hell warmed over. Lucky for you, I sell miracles in bottles.”</span>
He uncorks a flask — sweet, sharp qi wafts toward you.
<span class="male">“Hmmm.... it will be 150 spirit stones. It'll patch you up before the next round. Interested?”</span>
<<if $gold gte 150>>
<<linkappend "Buy healing potion">>
<<set $health to $maxhealth>>
<<set $energy to $maxenergy>>
<<set $gold -= 150>>
<p>You slap the coins into his palm. He grins and hands over the vial.</p>
<p><span class="male">“Pleasure doing business.”</span></p>
<p>You down the potion in one go. Warmth floods your limbs, wounds knitting closed. Strength returns.</p>
<</linkappend>>
<<else>>
<p>Your coin pouch is nearly empty.</p>
<p>The shopkeeper hums, amused. <span class="male">“No gold? Then maybe you'd be willing to... negotiate.”</span></p>
<p>He steps closer, eyes roaming shamelessly. <span class="male">“My potions are potent — surely worth a few moans?”</span></p>
<<if $corruption gte 20>>
<<link "Give in to his offer" "Tournament|MerchantSex">>
<<set $sexCumcount to 0, $sexPosition to "", $sexFinished to false>>
<<set $tournamentpassage to passage()>>
<<set $scene to 0>>
<</link>>
<</if>>
<<linkappend "Refuse and fight injured">>
<p>You shake your head. You’ll face the next battle bloodied but unbroken.</p>
<p>The shopkeeper shrugs. <span class="male">“Suit yourself. Just don’t die out there. I hate cleaning up corpses.”</span></p>
<</linkappend>>
<</if>>
<</linkappend>>
<</if>>
<</if>>
<</widget>><<widget "BackgroundHandler">>
<<if $backgroundClass eq "tavern">>
<img src="images/Background/tavern.jpg" style="width: 100%; display: block;">
<<elseif $backgroundClass eq "tavernRoom">>
<<set $random=random(1,2)>>
<<if $random eq 1>>
<img src="images/Background/tavernRoom.jpg" style="width: 100%; display: block;">
<<elseif $random eq 2>>
<img src="images/Background/tavernRoom1.jpg" style="width: 100%; display: block;">
<</if>>
<<else>>
<<set $random=random(1,10)>>
<<if $random eq 1>>
<img src="images/Background/bamboo_forest.jpg" style="width: 100%; display: block;">
<<elseif $random eq 2>>
<img src="images/Background/bamboo_forest1.jpg" style="width: 100%; display: block;">
<<elseif $random eq 3>>
<img src="images/Background/mountain_top.jpg" style="width: 100%; display: block;">
<<elseif $random eq 4>>
<img src="images/Background/mountain_top1.jpg" style="width: 100%; display: block;">
<<elseif $random eq 5>>
<img src="images/Background/plumgrove.jpg" style="width: 100%; display: block;">
<<elseif $random eq 6>>
<img src="images/Background/plumgrove1.jpg" style="width: 100%; display: block;">
<<elseif $random eq 7>>
<img src="images/Background/waterfall.jpg" style="width: 100%; display: block;">
<<elseif $random eq 8>>
<img src="images/Background/waterfall1.jpg" style="width: 100%; display: block;">
<<elseif $random eq 9>>
<img src="images/Background/forest.jpg" style="width: 100%; display: block;">
<<elseif $random eq 10>>
<img src="images/Background/forest1.jpg" style="width: 100%; display: block;">
<</if>><</if>>
<</widget>><<widget "BeforeBattle">>
<<set _enemy = $args[0] ?? _npc>>
<<set _healthMin = $args[1] ?? 1>>
<<set _healthMax = $args[2] ?? _healthMin>>
<<set $currentEnemy to clone(_enemy)>>
/* Use Math.random() to avoid integer floor issue */
<<set $currentEnemy.NPCcurrenthealth to Math.floor($currentEnemy.NPCmaxhealth * (_healthMin + Math.random() * (_healthMax - _healthMin)))>>
<<set $currentEnemy.NPCcurrentenergy to $currentEnemy.NPCmaxenergy>>
<<set $battleWon = false>>
<<set $defeatedEnemy = null>>
<<set $playerLost = false>>
<<set $returnpassage to passage()>>
<</widget>>
<<widget "PlayerAttackAttempt">>
<<set _hitChance = 50 + ($agility - $currentEnemy.NPCagility)>>
/* clamp */
<<set _hitChance = Math.max(10, Math.min(90, _hitChance))>>
<<set _roll = random(1,100)>>
<<if _roll <= _hitChance>>
<<set $playeraction = "attack success">>
<<else>>
<<set $playeraction = "attack failure">>
<br>─── ⚔️ ───<br>
<</if>>
<</widget>>
<<widget "PlayerAttackDamage">>
<<set $playermindamage = Math.round($atk * 0.8)>>
<<set $playermaxdamage = Math.round($atk * 1.2 + ($basestrength / 3) + ($martialArts / 4))>>
<<set $playerdamageroll = random($playermindamage, $playermaxdamage)>>
<<set $playerdamagerolltotal = $playerdamageroll + ($basestrength / 2)>>
<<set $damagetoenemy = Math.round($playerdamagerolltotal - $currentEnemy.NPCdef)>>
<<if $damagetoenemy lt 0>>
<<set $damagetoenemy = 0>>
<</if>>
<<set $currentEnemy.NPCcurrenthealth -= $damagetoenemy>>
<<if $currentEnemy.NPCcurrenthealth lt 0>>
<<set $currentEnemy.NPCcurrenthealth = 0>>
<</if>>
<<set $temp_player_damage = $damagetoenemy>>
<<if $temp_player_damage lte 0>>
<<set $temp_player_damage = random(1,3)>>
Your strike bounces off the enemy's skin — it's as if you're punching a steel wall powered by spiritual essence.
You deal <<print $damagetoenemy.toFixed(2)>> damage!
<<else>>
You channel your Qi into your strike... It pierces the enemy's defense!
You strike your enemy, dealing <<print $damagetoenemy.toFixed(2)>> damage!
<</if>>
<</widget>>
<<widget "EnemyAttackAttempt">>
<<set _hitChance = 50 + ($currentEnemy.NPCagility - $agility)>>
<<set _hitChance = Math.max(10, Math.min(90, _hitChance))>>
<<set _roll = random(1,100)>>
<<if _roll <= _hitChance>>
<<set $enemyaction = "attack success">>
<<else>>
<<set $enemyaction = "attack failure">>
<br>─── ⚔️ ───<br>
<</if>>
<</widget>>
<<widget "EnemyAttackDamage">>
<<set $enemymindamage = Math.round($currentEnemy.NPCatk * 0.8)>>
<<set $enemymaxdamage = Math.round($currentEnemy.NPCatk * 1.2 + ($currentEnemy.NPCbasestrength / 3) + ($currentEnemy.NPCmartialArts / 4))>>
<<set $enemydamageroll = random($enemymindamage, $enemymaxdamage)>>
<<set $enemydamagerolltotal = $enemydamageroll + ($currentEnemy.NPCbasestrength / 2)>>
<<set $damagetoplayer = Math.round($enemydamagerolltotal - $def)>>
<<if $damagetoplayer lt 0>>
<<set $damagetoplayer = 0>>
<</if>>
<<set $health -= $damagetoplayer>>
<<if $health lt 0>>
<<set $health = 0>>
<</if>>
<<set $temp_enemy_damage = $damagetoplayer>>
<<if $temp_enemy_damage lte 0>>
<<set $temp_enemy_damage = random(1, 3)>>
Your defensive technique holds — you feel nothing.
<<else>>
The enemy strikes you fiercely, dealing <<print $damagetoplayer.toFixed(2)>> damage!
<<set _random to random(0,100)>>
<<if _random lte 10>>
Enemy attack torn a small part of your robes!
<<set $equippedRobe.durability -= random(5, 10)>>
<</if>>
<</if>>
<</widget>>
<<widget "EnemyBattleTable">>
<div class="xianxia-enemy-table">
<div class="xianxia-name"><<print $currentEnemy.fullname>></div>
<div class="xianxia-enemy-table-splitter"></div>
<<if $currentEnemy.realm>>
<div class="xianxia-realm">$currentEnemy.realm</div>
<</if>>
<div class="xianxia-enemy-table-splitter"></div>
<div style="display: flex; flex-direction: row; justify-content: center; align-items: center;">
<div class="xianxia-label" style="margin: 0px 1em 0px 0px;">Health:</div>
<div class="xianxia-value"><<print $currentEnemy.NPCcurrenthealth.toFixed(0)>> / <<print $currentEnemy.NPCmaxhealth>></div>
</div>
<div class="xianxia-enemy-table-splitter"></div>
<<if $currentEnemy.NPCcurrenthealth == $currentEnemy.NPCmaxhealth>>
<img src="images/Story/health10.png" width="200" />
<<elseif $currentEnemy.NPCcurrenthealth >= ($currentEnemy.NPCmaxhealth * 0.9)>>
<img src="images/Story/health9.png" width="200" />
<<elseif $currentEnemy.NPCcurrenthealth >= ($currentEnemy.NPCmaxhealth * 0.8)>>
<img src="images/Story/health8.png" width="200" />
<<elseif $currentEnemy.NPCcurrenthealth >= ($currentEnemy.NPCmaxhealth * 0.7)>>
<img src="images/Story/health7.png" width="200" />
<<elseif $currentEnemy.NPCcurrenthealth >= ($currentEnemy.NPCmaxhealth * 0.6)>>
<img src="images/Story/health6.png" width="200" />
<<elseif $currentEnemy.NPCcurrenthealth >= ($currentEnemy.NPCmaxhealth * 0.5)>>
<img src="images/Story/health5.png" width="200" />
<<elseif $currentEnemy.NPCcurrenthealth >= ($currentEnemy.NPCmaxhealth * 0.4)>>
<img src="images/Story/health4.png" width="200" />
<<elseif $currentEnemy.NPCcurrenthealth >= ($currentEnemy.NPCmaxhealth * 0.3)>>
<img src="images/Story/health3.png" width="200" />
<<elseif $currentEnemy.NPCcurrenthealth >= ($currentEnemy.NPCmaxhealth * 0.2)>>
<img src="images/Story/health2.png" width="200" />
<<elseif $currentEnemy.NPCcurrenthealth >= ($currentEnemy.NPCmaxhealth * 0.1)>>
<img src="images/Story/health1.png" width="200" />
<<else>>
<img src="images/Story/health0.png" width="200" />
<</if>>
</div>
<</widget>>
<<widget "EnemyStun">>\
<<set $enemyaction = $currentEnemy.enemyAbility.random()>>
<<set $currentEnemy.enemyAbility.push($enemyaction)>>
<</widget>>
<<widget "AfterBattle">>
<<set $passiveatk to 0>>
<<set $passivedef to 0>>
<<set $passivecrit to 0>>
<<set $passivecritres to 0>>
<<set $passiveagility to 0>>
<<set $battleRound to 0>>
<</widget>>
<!-- ================ALLY ACTIONS=========================-->
<!--Creating help -->
<<widget "applyWorldDifficultyScaling">>
/*
$args[0]: difficulty (1=easiest, 5=deadliest)
$args[1]: variance (true/false) – if true, add random shifts for unpredictability
Sets _targetRealm and _targetStage for NPC generation.
*/
<<set _difficulty to $args[0] ?? 3>>
<<set _variance to $args[1] ?? false>>
/* Get Player Indices */
<<set _pRealmIdx to $cultivationRealms.indexOf($cultivationRealm)>>
<<set _pStageIdx to $cultivationStages.indexOf($cultivationStage)>>
<<if _pRealmIdx < 0>><<set _pRealmIdx = 0>><</if>>
<<if _pStageIdx < 0>><<set _pStageIdx = 0>><</if>>
<<set _maxRealmIdx = $cultivationRealms.length - 1>>
<<set _maxStageIdx = $cultivationStages.length - 1>> /* usually 2 (Early, Middle, Late) */
/* Default shifts – no change */
<<set _realmShift = 0>>
<<set _stageShift = 0>>
/* Base shifts depending on difficulty */
<<if _difficulty is 1>>
/* Easy – opponent weaker than player */
<<set _realmShift = -1>>
<<set _stageShift = -1>>
<<elseif _difficulty is 2>>
/* Slightly weaker */
<<set _realmShift = -1>>
<<set _stageShift = 0>>
<<elseif _difficulty is 3>>
/* Even match */
<<set _realmShift = 0>>
<<set _stageShift = 0>>
<<elseif _difficulty is 4>>
/* Slightly stronger */
<<set _realmShift = 0>>
<<set _stageShift = 1>>
<<elseif _difficulty is 5>>
/* Boss or lethal threat */
<<set _realmShift = 1>>
<<set _stageShift = 0>>
<</if>>
/* Optional randomness to mix things up */
<<if _variance>>
/* 30% chance of a realm shift +/- 1 beyond base */
<<if random(1, 100) lte 30>>
<<set _realmShift += random(-1, 1)>>
<</if>>
/* 40% chance of a stage shift */
<<if random(1, 100) lte 40>>
<<set _stageShift += random(-1, 1)>>
<</if>>
<</if>>
/* Apply shifts and clamp */
<<set _enemyRealmIdx = Math.max(0, Math.min(_maxRealmIdx, _pRealmIdx + _realmShift))>>
<<set _enemyStageIdx = Math.max(0, Math.min(_maxStageIdx, _pStageIdx + _stageShift))>>
/* Safety fallback */
<<if _enemyRealmIdx < 0 or _enemyRealmIdx > _maxRealmIdx>>
<<set _enemyRealmIdx = _pRealmIdx>>
<</if>>
<<if _enemyStageIdx < 0 or _enemyStageIdx > _maxStageIdx>>
<<set _enemyStageIdx = _pStageIdx>>
<</if>>
/* Set target for CreateNPC001 */
<<set _targetRealm to $cultivationRealms[_enemyRealmIdx]>>
<<set _targetStage to $cultivationStages[_enemyStageIdx]>>
<</widget>><<widget "TeamBeforeBattle">>
<!-- Enemy no. 1 -->
<<set $currentEnemy1 to clone($enemyAlly1)>>
<<set $currentEnemy1.NPCcurrenthealth to $currentEnemy1.NPCmaxhealth>>
<<set $currentEnemy1.NPCcurrentenergy to $currentEnemy1.NPCmaxenergy>>
<!-- Enemy no. 2 -->
<<set $currentEnemy2 to clone($enemyAlly2)>>
<<set $currentEnemy2.NPCcurrenthealth to $currentEnemy2.NPCmaxhealth>>
<<set $currentEnemy2.NPCcurrentenergy to $currentEnemy2.NPCmaxenergy>>
<!-- Enemy no. 3 -->
<<set $currentEnemy3 to clone($enemyAlly3)>>
<<set $currentEnemy3.NPCcurrenthealth to $currentEnemy3.NPCmaxhealth>>
<<set $currentEnemy3.NPCcurrentenergy to $currentEnemy3.NPCmaxenergy>>
<!-- Enemy no. 4 -->
<<set $currentEnemy4 to clone($enemyAlly4)>>
<<set $currentEnemy4.NPCcurrenthealth to $currentEnemy4.NPCmaxhealth>>
<<set $currentEnemy4.NPCcurrentenergy to $currentEnemy4.NPCmaxenergy>>
<<set $battleWon = false>>
<<set $defeatedEnemy = null>>
<<set $playerLost = false>>
<<set $returnpassage to passage()>>
<</widget>>
<!-- ═══════════════════════════════════════════════════════════════════════
ALLY ATTACKS - Simple
═══════════════════════════════════════════════════════════════════════ -->
<<widget "AllyAttackAttempt">>
<<set _hitChance = 50 + ($args[0].NPCagility - $args[1].NPCagility)>>
<<set _hitChance = Math.max(10, Math.min(90, _hitChance))>>
<<set _roll = random(1,100)>>
<<if _roll <= _hitChance>>
<<set $allyaction = "attack success">>
<<else>>
<<set $allyaction = "attack failure">>
<</if>>
<</widget>>
<<widget "AllyAttackDamage">>
<<set _ally = $args[0]>>
<<set _target = $args[1]>>
<<set _mindamage = Math.round(_ally.NPCatk * 0.8)>>
<<set _maxdamage = Math.round(_ally.NPCatk * 1.2 + (_ally.NPCbasestrength / 3) + (_ally.NPCmartialArts / 4))>>
<<set _damageroll = random(_mindamage, _maxdamage)>>
<<set _damagerolltotal = _damageroll + (_ally.NPCbasestrength / 2)>>
<<set _damagetoenemy = Math.round(_damagerolltotal - _target.NPCdef)>>
<<if _damagetoenemy lt 0>>
<<set _damagetoenemy = 0>>
<</if>>
<<set _target.NPCcurrenthealth -= _damagetoenemy>>
<<if _target.NPCcurrenthealth lt 0>>
<<set _target.NPCcurrenthealth = 0>>
<</if>>
<<if _damagetoenemy lte 0>>
<<print _ally.fullname>>'s strike bounces off! (0 damage)
<<else>>
<<print _ally.fullname>> strikes <<print _target.fullname>> for <<print _damagetoenemy.toFixed(2)>> damage!
<</if>>
<</widget>>
<!-- ═══════════════════════════════════════════════════════════════════════
ENEMY ATTACKS - With targeting (player or ally)
═══════════════════════════════════════════════════════════════════════ -->
<<widget "EnemyTeamAttackAttempt">>
<<set _enemy = $args[0]>>
<<set _target = $args[1]>>
<<set _hitChance = 50 + (_enemy.NPCagility - _target.NPCagility)>>
<<set _hitChance = Math.max(10, Math.min(90, _hitChance))>>
<<set _roll = random(1,100)>>
<<if _roll <= _hitChance>>
<<set $enemyaction = "attack success">>
<<else>>
<<set $enemyaction = "attack failure">>
<</if>>
<</widget>>
<<widget "EnemyTeamAttackDamage">>
<<set _enemy = $args[0]>>
<<set _target = $args[1]>>
<<set _isPlayer = $args[2] ?? false>>
<<set _mindamage = Math.round(_enemy.NPCatk * 0.8)>>
<<set _maxdamage = Math.round(_enemy.NPCatk * 1.2 + (_enemy.NPCbasestrength / 3) + (_enemy.NPCmartialArts / 4))>>
<<set _damageroll = random(_mindamage, _maxdamage)>>
<<set _damagerolltotal = _damageroll + (_enemy.NPCbasestrength / 2)>>
<<set _damagetotarget = Math.round(_damagerolltotal - _target.NPCdef)>>
<<if _damagetotarget lt 0>>
<<set _damagetotarget = 0>>
<</if>>
<<if _isPlayer>>
<<set $health -= _damagetotarget>>
<<if $health lt 0>>
<<set $health = 0>>
<</if>>
<<else>>
<<set _target.NPCcurrenthealth -= _damagetotarget>>
<<if _target.NPCcurrenthealth lt 0>>
<<set _target.NPCcurrenthealth = 0>>
<</if>>
<</if>>
<<if _damagetotarget lte 0>>
<<print _enemy.fullname>>'s attack is blocked! (0 damage)
<<else>>
<<print _enemy.fullname>> strikes <<print _target.fullname>> for <<print _damagetotarget.toFixed(2)>> damage!
<</if>>
<</widget>>
<<widget "EnemyGroupBattleTable">>
<div style="display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; justify-items: center;">
<<for _enemy range $enemyTeam>>
<div class="xianxia-enemy-table" style="display: flex; flex-direction: column; align-items: center; padding-bottom: 10px;">
<<if _enemy.NPCcurrenthealth >= 0>>
<div class="xianxia-name"><<print _enemy.fullname>></div>
<div class="xianxia-enemy-table-splitter"></div>
<<if _enemy.realm>>
<div class="xianxia-realm"><<print _enemy.realm>></div>
<</if>>
<div class="xianxia-enemy-table-splitter"></div>
<div style="display: flex; flex-direction: row; justify-content: center; align-items: center; width: 100%;">
<div class="xianxia-label" style="margin: 0px 1em 0px 0px;">Health:</div>
<<if _enemy.NPCcurrenthealth gt 0>>
<div class="xianxia-value"><<print _enemy.NPCcurrenthealth.toFixed(0)>> / <<print _enemy.NPCmaxhealth>></div>
<<else>>
<p style="color:#888; text-align: center;">(Defeated)</p>
<</if>>
</div>
<</if>>
</div>
<</for>>
</div>
<</widget>>
<<widget "AllyGroupBattleTable">>
<div style="display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; justify-items: center;">
<<for _ally range $allyTeam>>
<div class="xianxia-ally-table" style="display: flex; flex-direction: column; align-items: center; padding-bottom: 10px;">
<<if _ally.NPCcurrenthealth >= 0>>
<div class="xianxia-name"><<print _ally.fullname>></div>
<div class="xianxia-ally-table-splitter"></div>
<<if _ally.realm>>
<div class="xianxia-realm"><<print _ally.realm>></div>
<</if>>
<div class="xianxia-ally-table-splitter"></div>
<div style="display: flex; flex-direction: row; justify-content: center; align-items: center; width: 100%;">
<div class="xianxia-label" style="margin: 0px 1em 0px 0px;">Health:</div>
<<if _ally.NPCcurrenthealth gt 0>>
<div class="xianxia-value"><<print _ally.NPCcurrenthealth.toFixed(0)>> / <<print _ally.NPCmaxhealth>></div>
<<else>>
<p style="color:#888; text-align: center;">(Defeated)</p>
<</if>>
</div>
<</if>>
</div>
<</for>>
</div>
<</widget>>
<!-- ═════════════════════════════════════════════════════════════
TEAM BATTLE - PLAYER ATTACK (uses $enemyTeam array)
═════════════════════════════════════════════════════════════ -->
<<widget "PlayerTeamAttackAttempt">>
<<set _target = $enemyTeam[$playerTargetIdx]>>
<<set _hitChance = 50 + ($agility - _target.NPCagility)>>
<<set _hitChance = Math.max(10, Math.min(90, _hitChance))>>
<<set _roll = random(1,100)>>
<<if _roll <= _hitChance>>
<<set $playeraction = "attack success">>
<<else>>
<<set $playeraction = "attack failure">>
<</if>>
<</widget>>
<<widget "PlayerTeamAttackDamage">>
<<set _target = $enemyTeam[$playerTargetIdx]>>
<<set $playermindamage = Math.round($atk * 0.8)>>
<<set $playermaxdamage = Math.round($atk * 1.2 + ($basestrength / 3) + ($martialArts / 4))>>
<<set $playerdamageroll = random($playermindamage, $playermaxdamage)>>
<<set $playerdamagerolltotal = $playerdamageroll + ($basestrength / 2)>>
<<set $damagetoenemy = Math.round($playerdamagerolltotal - _target.NPCdef)>>
<<if $damagetoenemy lt 0>>
<<set $damagetoenemy = 0>>
<</if>>
<<set _target.NPCcurrenthealth -= $damagetoenemy>>
<<if _target.NPCcurrenthealth lt 0>>
<<set _target.NPCcurrenthealth = 0>>
<</if>>
<<if $damagetoenemy lte 0>>
Your strike bounces off the enemy's skin — it's as if you're punching a steel wall powered by spiritual essence.
You deal <<print $damagetoenemy.toFixed(2)>> damage!
<<else>>
You channel your Qi into your strike... It pierces the enemy's defense!
You strike your enemy, dealing <<print $damagetoenemy.toFixed(2)>> damage!
<</if>>
<</widget>><<widget "HumanPickFight">>
<<set _roll = ["RogueSwordsman","DemonicDisciple","RighteousDisciple","WanderingElder","BanditCultivator","DemonicAssassin"].random()>>
<<if _roll eq "RogueSwordsman">><<RogueSwordsman>>
<<elseif _roll eq "DemonicDisciple">><<DemonicDisciple>>
<<elseif _roll eq "RighteousDisciple">><<RighteousDisciple>>
<<elseif _roll eq "WanderingElder">><<WanderingElder>>
<<elseif _roll eq "BanditCultivator">><<BanditCultivator>>
<<elseif _roll eq "DemonicAssassin">><<DemonicAssassin>>
<</if>>
<</widget>>
/* ══════════════════════════════════════════════════════
HUMAN CULTIVATOR ENEMY WIDGETS
──────────────────────────────
All widgets follow the same structure as beast widgets.
Stats pulled from $GenerationNPCRealmStats.
_loot returns $gold amount scaled to realm.
Lewd ability strings: "grope_chest", "grope_thigh",
"grope_ass", "finger" — handle logic in battle system.
══════════════════════════════════════════════════════ */
/* ── Shared realm setup macro ──────────────────────────
Called at the top of every widget.
Sets: _realm, _stageType, _cultivation, _stats, _gold
───────────────────────────────────────────────────── */
<<widget "HumanEnemyRealmSetup">>
<<set _realm = ["Body Tempering Realm","Meridian Awakening Realm","Qi Condensation Realm","Foundation Establishment Realm","Core Formation Realm","Nascent Soul Realm"].random()>>
<<set _stageType = ["Early","Middle","Late"].random()>>
<<set _cultivation = _realm + " " + _stageType>>
<<set _stats = $GenerationNPCRealmStats[_realm][_stageType]>>
<<if _realm eq "Body Tempering Realm">>
<<set _gold = random(150, 200)>>
<<elseif _realm eq "Meridian Awakening Realm">>
<<set _gold = random(200, 350)>>
<<elseif _realm eq "Qi Condensation Realm">>
<<set _gold = random(350, 600)>>
<<elseif _realm eq "Foundation Establishment Realm">>
<<set _gold = random(600, 1000)>>
<<elseif _realm eq "Core Formation Realm">>
<<set _gold = random(1000, 2000)>>
<<else>>
<<set _gold = random(2000, 4000)>>
<</if>>
<</widget>>
/* ══════════════════════════════════════════════════════
1. ROGUE SWORDSMAN
Unaffiliated. Aggressive. High atk, low def.
══════════════════════════════════════════════════════ */
<<widget "RogueSwordsman">>\
<<silently>>\
<<HumanEnemyRealmSetup>>
<<set _gender = ["male","female"].random()>>
<<if _gender eq "male">>
<<set _name = $male_npc_names.random()>>
<<set _npcPortrait = "male" + random(1, 32)>>
<<else>>
<<set _name = $female_npc_names.random()>>
<<set _npcPortrait = "female" + random(1, 26)>>
<</if>>
<<set _surname = $npc_surnames.random()>>
<<set _fullname = _surname + " " + _name>>
<<set _enemyregion = "Enemy">>
<<set _enemyimage = "Rogue Swordsman1">>
<<set _sectAffiliation = "Unaffiliated">>
<<set _enemySect = ["righteous","demonic"].random()>>
<<set _sectRank = "">>
<<set _maxhealthNPC = random(_stats.health[0], _stats.health[1])>>
<<set _maxenergyNPC = random(_stats.energy[0], _stats.energy[1])>>
<<set _currenthealthNPC = _maxhealthNPC>>
<<set _currentenergyNPC = _maxenergyNPC>>
<<set _luckNPC = random(_stats.luck[0], _stats.luck[1])>>
<<set _insightNPC = random(_stats.insight[0], _stats.insight[1])>>
<<set _basestrengthNPC = random(_stats.basestrength[0], _stats.basestrength[1])>>
<<set _basewillpowerNPC = random(_stats.basewillpower[0], _stats.basewillpower[1])>>
<<set _atkNPC = random(_stats.atk[0], _stats.atk[1])>>
<<set _defNPC = random(_stats.def[0], _stats.def[1])>>
<<set _critNPC = random(_stats.crit[0], _stats.crit[1])>>
<<set _critresNPC = random(_stats.critres[0], _stats.critres[1])>>
<<set _agilityNPC = random(_stats.agility[0], _stats.agility[1])>>
<<set _martialArtsNPC = random(_stats.martialArts[0], _stats.martialArts[1])>>
<<set _spiritualRootNPC = random(_stats.spiritualRoot[0], _stats.spiritualRoot[1])>>
<<set _enemyEvadeScore = (_agilityNPC * 2) + (_insightNPC * 1.5) + (_luckNPC * 0.5)>>
<<set _enemyEXP = random(20, 50)>>
<<set _enemyability = ["attack","attack","attack","grope_chest","grope_thigh"]>>
<<set _loot = {gold: _gold}>>
<<set _description = "A swordsman with no sect and no allegiances — which means no rules either. Their blade is notched from hard use and their eyes carry the flat calm of someone who has made peace with violence.">>
<<set _npc = {
fullname: _fullname,
name: _name,
surname: _surname,
gender: _gender,
npcPortrait: _npcPortrait,
sectNPC: _sectAffiliation,
enemySectType: _enemySect,
NPCrank: _sectRank,
realm: _cultivation,
NPCmaxhealth: _maxhealthNPC,
NPCmaxenergy: _maxenergyNPC,
NPCcurrenthealth: _currenthealthNPC,
NPCcurrentenergy: _currentenergyNPC,
NPCluck: _luckNPC,
NPCinsight: _insightNPC,
NPCbasestrength: _basestrengthNPC,
NPCbasewillpower: _basewillpowerNPC,
NPCatk: _atkNPC,
NPCdef: _defNPC,
NPCcrit: _critNPC,
NPCcritres: _critresNPC,
NPCagility: _agilityNPC,
NPCmartialArts: _martialArtsNPC,
NPCspiritualRoot: _spiritualRootNPC,
enemyregion: _enemyregion,
enemyimage: _enemyimage,
enemyEvade: _enemyEvadeScore,
enemyAbility: _enemyability,
enemyDesc: _description,
enemyXP: _enemyEXP,
enemyLoot: _loot
}>>\
<</silently>>\
<</widget>>\
/* ══════════════════════════════════════════════════════
2. DEMONIC DISCIPLE
Ghost King Netherworld Sect. Aggressive and lewd.
══════════════════════════════════════════════════════ */
<<widget "DemonicDisciple">>\
<<silently>>\
<<HumanEnemyRealmSetup>>
<<set _gender = ["male","female"].random()>>
<<if _gender eq "male">>
<<set _name = $male_npc_names.random()>>
<<set _npcPortrait = "male" + random(1, 32)>>
<<else>>
<<set _name = $female_npc_names.random()>>
<<set _npcPortrait = "female" + random(1, 26)>>
<</if>>
<<set _surname = $npc_surnames.random()>>
<<set _fullname = _surname + " " + _name>>
<<set _enemyregion = "Enemy">>
<<set _enemyimage = "Demonic Disciple">>
<<set _sectAffiliation = "Ghost King Netherworld Sect">>
<<set _enemySect = "demonic">>
<<set _sectRank = ["Member","Disciple","Elder"].random()>>
<<set _maxhealthNPC = random(_stats.health[0], _stats.health[1])>>
<<set _maxenergyNPC = random(_stats.energy[0], _stats.energy[1])>>
<<set _currenthealthNPC = _maxhealthNPC>>
<<set _currentenergyNPC = _maxenergyNPC>>
<<set _luckNPC = random(_stats.luck[0], _stats.luck[1])>>
<<set _insightNPC = random(_stats.insight[0], _stats.insight[1])>>
<<set _basestrengthNPC = random(_stats.basestrength[0], _stats.basestrength[1])>>
<<set _basewillpowerNPC = random(_stats.basewillpower[0], _stats.basewillpower[1])>>
<<set _atkNPC = random(_stats.atk[0], _stats.atk[1])>>
<<set _defNPC = random(_stats.def[0], _stats.def[1])>>
<<set _critNPC = random(_stats.crit[0], _stats.crit[1])>>
<<set _critresNPC = random(_stats.critres[0], _stats.critres[1])>>
<<set _agilityNPC = random(_stats.agility[0], _stats.agility[1])>>
<<set _martialArtsNPC = random(_stats.martialArts[0], _stats.martialArts[1])>>
<<set _spiritualRootNPC = random(_stats.spiritualRoot[0], _stats.spiritualRoot[1])>>
<<set _enemyEvadeScore = (_agilityNPC * 2) + (_insightNPC * 1.5) + (_luckNPC * 0.5)>>
<<set _enemyEXP = random(25, 55)>>
<<set _enemyability = ["attack","attack","grope_chest","grope_ass","finger","grope_thigh","attack"]>>
<<set _loot = {gold: _gold}>>
<<set _description = "A disciple of the Ghost King Netherworld Sect, their robes dark as a starless sky. Dark qi coils around their hands. Their eyes move over you like they're already deciding what to do with you after you fall.">>
<<set _npc = {
fullname: _fullname,
name: _name,
surname: _surname,
gender: _gender,
npcPortrait: _npcPortrait,
sectNPC: _sectAffiliation,
enemySectType: _enemySect,
NPCrank: _sectRank,
realm: _cultivation,
NPCmaxhealth: _maxhealthNPC,
NPCmaxenergy: _maxenergyNPC,
NPCcurrenthealth: _currenthealthNPC,
NPCcurrentenergy: _currentenergyNPC,
NPCluck: _luckNPC,
NPCinsight: _insightNPC,
NPCbasestrength: _basestrengthNPC,
NPCbasewillpower: _basewillpowerNPC,
NPCatk: _atkNPC,
NPCdef: _defNPC,
NPCcrit: _critNPC,
NPCcritres: _critresNPC,
NPCagility: _agilityNPC,
NPCmartialArts: _martialArtsNPC,
NPCspiritualRoot: _spiritualRootNPC,
enemyregion: _enemyregion,
enemyimage: _enemyimage,
enemyEvade: _enemyEvadeScore,
enemyAbility: _enemyability,
enemyDesc: _description,
enemyXP: _enemyEXP,
enemyLoot: _loot
}>>\
<</silently>>\
<</widget>>\
/* ══════════════════════════════════════════════════════
3. RIGHTEOUS DISCIPLE
Clear Sky Azure Dragon Pavilion. Defensive, proud.
══════════════════════════════════════════════════════ */
<<widget "RighteousDisciple">>\
<<silently>>\
<<HumanEnemyRealmSetup>>
<<set _gender = ["male","female"].random()>>
<<if _gender eq "male">>
<<set _name = $male_npc_names.random()>>
<<set _npcPortrait = "male" + random(1, 32)>>
<<else>>
<<set _name = $female_npc_names.random()>>
<<set _npcPortrait = "female" + random(1, 26)>>
<</if>>
<<set _surname = $npc_surnames.random()>>
<<set _fullname = _surname + " " + _name>>
<<set _enemyregion = "Enemy">>
<<set _enemyimage = "Righteous Disciple">>
<<set _sectAffiliation = "Clear Sky Azure Dragon Pavilion">>
<<set _enemySect = "righteous">>
<<set _sectRank = ["Member","Disciple","Elder"].random()>>
<<set _maxhealthNPC = random(_stats.health[0], _stats.health[1])>>
<<set _maxenergyNPC = random(_stats.energy[0], _stats.energy[1])>>
<<set _currenthealthNPC = _maxhealthNPC>>
<<set _currentenergyNPC = _maxenergyNPC>>
<<set _luckNPC = random(_stats.luck[0], _stats.luck[1])>>
<<set _insightNPC = random(_stats.insight[0], _stats.insight[1])>>
<<set _basestrengthNPC = random(_stats.basestrength[0], _stats.basestrength[1])>>
<<set _basewillpowerNPC = random(_stats.basewillpower[0], _stats.basewillpower[1])>>
<<set _atkNPC = random(_stats.atk[0], _stats.atk[1])>>
<<set _defNPC = random(_stats.def[0], _stats.def[1])>>
<<set _critNPC = random(_stats.crit[0], _stats.crit[1])>>
<<set _critresNPC = random(_stats.critres[0], _stats.critres[1])>>
<<set _agilityNPC = random(_stats.agility[0], _stats.agility[1])>>
<<set _martialArtsNPC = random(_stats.martialArts[0], _stats.martialArts[1])>>
<<set _spiritualRootNPC = random(_stats.spiritualRoot[0], _stats.spiritualRoot[1])>>
<<set _enemyEvadeScore = (_agilityNPC * 2) + (_insightNPC * 1.5) + (_luckNPC * 0.5)>>
<<set _enemyEXP = random(25, 55)>>
<<set _enemyability = ["attack","defend","attack","defend","grope_thigh","attack"]>>
<<set _loot = {gold: _gold}>>
<<set _description = "A disciple of the Clear Sky Azure Dragon Pavilion, their azure robes immaculate despite the surroundings. They carry themselves with the quiet confidence of someone who trains twice as hard as they need to. Their expression makes clear they consider this beneath them.">>
<<set _npc = {
fullname: _fullname,
name: _name,
surname: _surname,
gender: _gender,
npcPortrait: _npcPortrait,
sectNPC: _sectAffiliation,
enemySectType: _enemySect,
NPCrank: _sectRank,
realm: _cultivation,
NPCmaxhealth: _maxhealthNPC,
NPCmaxenergy: _maxenergyNPC,
NPCcurrenthealth: _currenthealthNPC,
NPCcurrentenergy: _currentenergyNPC,
NPCluck: _luckNPC,
NPCinsight: _insightNPC,
NPCbasestrength: _basestrengthNPC,
NPCbasewillpower: _basewillpowerNPC,
NPCatk: _atkNPC,
NPCdef: _defNPC,
NPCcrit: _critNPC,
NPCcritres: _critresNPC,
NPCagility: _agilityNPC,
NPCmartialArts: _martialArtsNPC,
NPCspiritualRoot: _spiritualRootNPC,
enemyregion: _enemyregion,
enemyimage: _enemyimage,
enemyEvade: _enemyEvadeScore,
enemyAbility: _enemyability,
enemyDesc: _description,
enemyXP: _enemyEXP,
enemyLoot: _loot
}>>\
<</silently>>\
<</widget>>\
/* ══════════════════════════════════════════════════════
4. WANDERING ELDER
Unaffiliated. High realm. Unpredictable.
══════════════════════════════════════════════════════ */
<<widget "WanderingElder">>\
<<silently>>\
<<HumanEnemyRealmSetup>>
<<set _gender = ["male","female"].random()>>
<<if _gender eq "male">>
<<set _name = $male_npc_names.random()>>
<<set _npcPortrait = "male" + random(1, 32)>>
<<else>>
<<set _name = $female_npc_names.random()>>
<<set _npcPortrait = "female" + random(1, 26)>>
<</if>>
<<set _surname = $npc_surnames.random()>>
<<set _fullname = _surname + " " + _name>>
<<set _enemyregion = "Enemy">>
<<set _enemyimage = "Wandering Elder">>
<<set _sectAffiliation = "Unaffiliated">>
<<set _enemySect = ["righteous","demonic"].random()>>
<<set _sectRank = "">>
<<set _maxhealthNPC = random(_stats.health[0], _stats.health[1])>>
<<set _maxenergyNPC = random(_stats.energy[0], _stats.energy[1])>>
<<set _currenthealthNPC = _maxhealthNPC>>
<<set _currentenergyNPC = _maxenergyNPC>>
<<set _luckNPC = random(_stats.luck[0], _stats.luck[1])>>
<<set _insightNPC = random(_stats.insight[0], _stats.insight[1])>>
<<set _basestrengthNPC = random(_stats.basestrength[0], _stats.basestrength[1])>>
<<set _basewillpowerNPC = random(_stats.basewillpower[0], _stats.basewillpower[1])>>
<<set _atkNPC = random(_stats.atk[0], _stats.atk[1])>>
<<set _defNPC = random(_stats.def[0], _stats.def[1])>>
<<set _critNPC = random(_stats.crit[0], _stats.crit[1])>>
<<set _critresNPC = random(_stats.critres[0], _stats.critres[1])>>
<<set _agilityNPC = random(_stats.agility[0], _stats.agility[1])>>
<<set _martialArtsNPC = random(_stats.martialArts[0], _stats.martialArts[1])>>
<<set _spiritualRootNPC = random(_stats.spiritualRoot[0], _stats.spiritualRoot[1])>>
<<set _enemyEvadeScore = (_agilityNPC * 2) + (_insightNPC * 1.5) + (_luckNPC * 0.5)>>
<<set _enemyEXP = random(40, 80)>>
<<set _enemyability = ["attack","attack","defend","attack","grope_chest","grope_ass"]>>
<<set _loot = {gold: _gold}>>
<<set _description = "An elder with no sect name and no introduction. Their robes are travel-worn but their qi pressure is unmistakable — the kind that accumulates over centuries of surviving things that killed everyone else in the room. They are not here by accident.">>
<<set _npc = {
fullname: _fullname,
name: _name,
surname: _surname,
gender: _gender,
npcPortrait: _npcPortrait,
sectNPC: _sectAffiliation,
enemySectType: _enemySect,
NPCrank: _sectRank,
realm: _cultivation,
NPCmaxhealth: _maxhealthNPC,
NPCmaxenergy: _maxenergyNPC,
NPCcurrenthealth: _currenthealthNPC,
NPCcurrentenergy: _currentenergyNPC,
NPCluck: _luckNPC,
NPCinsight: _insightNPC,
NPCbasestrength: _basestrengthNPC,
NPCbasewillpower: _basewillpowerNPC,
NPCatk: _atkNPC,
NPCdef: _defNPC,
NPCcrit: _critNPC,
NPCcritres: _critresNPC,
NPCagility: _agilityNPC,
NPCmartialArts: _martialArtsNPC,
NPCspiritualRoot: _spiritualRootNPC,
enemyregion: _enemyregion,
enemyimage: _enemyimage,
enemyEvade: _enemyEvadeScore,
enemyAbility: _enemyability,
enemyDesc: _description,
enemyXP: _enemyEXP,
enemyLoot: _loot
}>>\
<</silently>>\
<</widget>>\
/* ══════════════════════════════════════════════════════
5. BANDIT CULTIVATOR
Unaffiliated. Low aggression, opportunistic.
Heavy lewd pool — takes advantage when winning.
══════════════════════════════════════════════════════ */
<<widget "BanditCultivator">>\
<<silently>>\
<<HumanEnemyRealmSetup>>
<<set _gender = ["male","female"].random()>>
<<if _gender eq "male">>
<<set _name = $male_npc_names.random()>>
<<set _npcPortrait = "male" + random(1, 32)>>
<<else>>
<<set _name = $female_npc_names.random()>>
<<set _npcPortrait = "female" + random(1, 26)>>
<</if>>
<<set _surname = $npc_surnames.random()>>
<<set _fullname = _surname + " " + _name>>
<<set _enemyregion = "Enemy">>
<<set _enemyimage = "Bandit Cultivator">>
<<set _sectAffiliation = "Unaffiliated">>
<<set _enemySect = "demonic">>
<<set _sectRank = "">>
<<set _maxhealthNPC = random(_stats.health[0], _stats.health[1])>>
<<set _maxenergyNPC = random(_stats.energy[0], _stats.energy[1])>>
<<set _currenthealthNPC = _maxhealthNPC>>
<<set _currentenergyNPC = _maxenergyNPC>>
<<set _luckNPC = random(_stats.luck[0], _stats.luck[1])>>
<<set _insightNPC = random(_stats.insight[0], _stats.insight[1])>>
<<set _basestrengthNPC = random(_stats.basestrength[0], _stats.basestrength[1])>>
<<set _basewillpowerNPC = random(_stats.basewillpower[0], _stats.basewillpower[1])>>
<<set _atkNPC = random(_stats.atk[0], _stats.atk[1])>>
<<set _defNPC = random(_stats.def[0], _stats.def[1])>>
<<set _critNPC = random(_stats.crit[0], _stats.crit[1])>>
<<set _critresNPC = random(_stats.critres[0], _stats.critres[1])>>
<<set _agilityNPC = random(_stats.agility[0], _stats.agility[1])>>
<<set _martialArtsNPC = random(_stats.martialArts[0], _stats.martialArts[1])>>
<<set _spiritualRootNPC = random(_stats.spiritualRoot[0], _stats.spiritualRoot[1])>>
<<set _enemyEvadeScore = (_agilityNPC * 2) + (_insightNPC * 1.5) + (_luckNPC * 0.5)>>
<<set _enemyEXP = random(15, 35)>>
<<set _enemyability = ["attack","grope_chest","grope_thigh","grope_ass","finger","attack","grope_chest"]>>
<<set _loot = {gold: _gold}>>
<<set _description = "A cultivator who gave up on a legitimate path — or was never offered one. Their technique is rough and self-taught, full of holes, but they've learned to fight dirty to compensate. They size you up with unconcealed interest.">>
<<set _npc = {
fullname: _fullname,
name: _name,
surname: _surname,
gender: _gender,
npcPortrait: _npcPortrait,
sectNPC: _sectAffiliation,
enemySectType: _enemySect,
NPCrank: _sectRank,
realm: _cultivation,
NPCmaxhealth: _maxhealthNPC,
NPCmaxenergy: _maxenergyNPC,
NPCcurrenthealth: _currenthealthNPC,
NPCcurrentenergy: _currentenergyNPC,
NPCluck: _luckNPC,
NPCinsight: _insightNPC,
NPCbasestrength: _basestrengthNPC,
NPCbasewillpower: _basewillpowerNPC,
NPCatk: _atkNPC,
NPCdef: _defNPC,
NPCcrit: _critNPC,
NPCcritres: _critresNPC,
NPCagility: _agilityNPC,
NPCmartialArts: _martialArtsNPC,
NPCspiritualRoot: _spiritualRootNPC,
enemyregion: _enemyregion,
enemyimage: _enemyimage,
enemyEvade: _enemyEvadeScore,
enemyAbility: _enemyability,
enemyDesc: _description,
enemyXP: _enemyEXP,
enemyLoot: _loot
}>>\
<</silently>>\
<</widget>>\
/* ══════════════════════════════════════════════════════
6. DEMONIC ASSASSIN
Ghost King Netherworld Sect. High agility/crit.
Strikes fast, uses openings lewdly.
══════════════════════════════════════════════════════ */
<<widget "DemonicAssassin">>\
<<silently>>\
<<HumanEnemyRealmSetup>>
<<set _gender = ["male","female"].random()>>
<<if _gender eq "male">>
<<set _name = $male_npc_names.random()>>
<<set _npcPortrait = "male" + random(1, 32)>>
<<else>>
<<set _name = $female_npc_names.random()>>
<<set _npcPortrait = "female" + random(1, 26)>>
<</if>>
<<set _surname = $npc_surnames.random()>>
<<set _fullname = _surname + " " + _name>>
<<set _enemyregion = "Enemy">>
<<set _enemyimage = "Demonic Assassin">>
<<set _sectAffiliation = "Ghost King Netherworld Sect">>
<<set _enemySect = "demonic">>
<<set _sectRank = ["Member","Disciple"].random()>>
<<set _maxhealthNPC = random(_stats.health[0], _stats.health[1])>>
<<set _maxenergyNPC = random(_stats.energy[0], _stats.energy[1])>>
<<set _currenthealthNPC = _maxhealthNPC>>
<<set _currentenergyNPC = _maxenergyNPC>>
<<set _luckNPC = random(_stats.luck[0], _stats.luck[1])>>
<<set _insightNPC = random(_stats.insight[0], _stats.insight[1])>>
<<set _basestrengthNPC = random(_stats.basestrength[0], _stats.basestrength[1])>>
<<set _basewillpowerNPC = random(_stats.basewillpower[0], _stats.basewillpower[1])>>
<<set _atkNPC = random(_stats.atk[0], _stats.atk[1])>>
<<set _defNPC = random(_stats.def[0], _stats.def[1])>>
<<set _critNPC = random(_stats.crit[0], _stats.crit[1])>>
<<set _critresNPC = random(_stats.critres[0], _stats.critres[1])>>
<<set _agilityNPC = random(_stats.agility[0], _stats.agility[1])>>
<<set _martialArtsNPC = random(_stats.martialArts[0], _stats.martialArts[1])>>
<<set _spiritualRootNPC = random(_stats.spiritualRoot[0], _stats.spiritualRoot[1])>>
<<set _enemyEvadeScore = (_agilityNPC * 2) + (_insightNPC * 1.5) + (_luckNPC * 0.5)>>
<<set _enemyEXP = random(30, 65)>>
<<set _enemyability = ["attack","attack","evade","attack","finger","grope_chest","grope_ass","attack"]>>
<<set _loot = {gold: _gold}>>
<<set _description = "A shadow that moves wrong — too fast, too quiet, arriving where you weren't watching. Their Ghost King sect mark is hidden under a plain collar but the dark qi signature is unmistakable up close. They fight with the economy of someone paid per second.">>
<<set _npc = {
fullname: _fullname,
name: _name,
surname: _surname,
gender: _gender,
npcPortrait: _npcPortrait,
sectNPC: _sectAffiliation,
enemySectType: _enemySect,
NPCrank: _sectRank,
realm: _cultivation,
NPCmaxhealth: _maxhealthNPC,
NPCmaxenergy: _maxenergyNPC,
NPCcurrenthealth: _currenthealthNPC,
NPCcurrentenergy: _currentenergyNPC,
NPCluck: _luckNPC,
NPCinsight: _insightNPC,
NPCbasestrength: _basestrengthNPC,
NPCbasewillpower: _basewillpowerNPC,
NPCatk: _atkNPC,
NPCdef: _defNPC,
NPCcrit: _critNPC,
NPCcritres: _critresNPC,
NPCagility: _agilityNPC,
NPCmartialArts: _martialArtsNPC,
NPCspiritualRoot: _spiritualRootNPC,
enemyregion: _enemyregion,
enemyimage: _enemyimage,
enemyEvade: _enemyEvadeScore,
enemyAbility: _enemyability,
enemyDesc: _description,
enemyXP: _enemyEXP,
enemyLoot: _loot
}>>\
<</silently>>\
<</widget>>\/* Game Update Widget for 0.16*/
<<widget "GameUpdateWidget-016">>
<<set $cultivationRealms = ["Body Tempering Realm", "Meridian Awakening Realm", "Qi Condensation Realm", "Foundation Establishment Realm", "Core Formation Realm", "Nascent Soul Realm"]>>
<<set $cultivationStages = ["Early", "Middle", "Late"]>>
<<set $GenerationNPCRealmStats = {
"Body Tempering Realm": {
"Early": {
"lifespan": [70, 80],
"health": [250, 320],
"energy": [180, 220],
"luck": [4, 6],
"insight": [4, 6],
"basestrength": [4, 6],
"basewillpower": [4, 6],
"atk": [35, 45],
"def": [4, 6],
"crit": [2, 4],
"critres": [1, 2],
"agility": [6, 8],
"martialArts": [8, 12],
"spiritualRoot": [9, 11]
},
"Middle": {
"lifespan": [85, 115],
"health": [350, 450],
"energy": [250, 320],
"luck": [6, 10],
"insight": [6, 10],
"basestrength": [7, 10],
"basewillpower": [6, 9],
"atk": [45, 85],
"def": [6, 10],
"crit": [4, 7],
"critres": [3, 5],
"agility": [8, 12],
"martialArts": [12, 18],
"spiritualRoot": [11, 14]
},
"Late": {
"lifespan": [115, 130],
"health": [500, 700],
"energy": [350, 500],
"luck": [8, 14],
"insight": [10, 16],
"basestrength": [11, 15],
"basewillpower": [10, 14],
"atk": [85, 120],
"def": [12, 18],
"crit": [6, 10],
"critres": [6, 10],
"agility": [12, 18],
"martialArts": [16, 25],
"spiritualRoot": [15, 20]
}
},
"Meridian Awakening Realm": {
"Early": {
"lifespan": [135, 140],
"health": [750, 900],
"energy": [600, 720],
"luck": [10, 14],
"insight": [12, 16],
"basestrength": [16, 20],
"basewillpower": [14, 18],
"atk": [120, 170],
"def": [20, 30],
"crit": [8, 12],
"critres": [8, 12],
"agility": [16, 22],
"martialArts": [24, 32],
"spiritualRoot": [22, 30]
},
"Middle": {
"lifespan": [145, 150],
"health": [1000, 1200],
"energy": [800, 1000],
"luck": [14, 20],
"insight": [18, 24],
"basestrength": [20, 26],
"basewillpower": [18, 24],
"atk": [170, 220],
"def": [28, 40],
"crit": [10, 16],
"critres": [10, 16],
"agility": [22, 30],
"martialArts": [30, 40],
"spiritualRoot": [28, 36]
},
"Late": {
"lifespan": [155, 160],
"health": [1400, 1800],
"energy": [1200, 1600],
"luck": [20, 28],
"insight": [26, 34],
"basestrength": [28, 36],
"basewillpower": [26, 32],
"atk": [220, 270],
"def": [40, 55],
"crit": [14, 20],
"critres": [14, 20],
"agility": [30, 40],
"martialArts": [38, 50],
"spiritualRoot": [35, 45]
}
},
"Qi Condensation Realm": {
"Early": {
"lifespan": [165, 170],
"health": [1900, 2300],
"energy": [1700, 2100],
"luck": [15, 20],
"insight": [20, 26],
"basestrength": [30, 38],
"basewillpower": [28, 35],
"atk": [300, 380],
"def": [45, 65],
"crit": [12, 18],
"critres": [12, 18],
"agility": [35, 45],
"martialArts": [45, 60],
"spiritualRoot": [40, 55]
},
"Middle": {
"lifespan": [175, 185],
"health": [2400, 2900],
"energy": [2200, 2700],
"luck": [20, 28],
"insight": [26, 34],
"basestrength": [38, 48],
"basewillpower": [35, 44],
"atk": [380, 480],
"def": [60, 85],
"crit": [16, 24],
"critres": [16, 24],
"agility": [45, 58],
"martialArts": [58, 75],
"spiritualRoot": [52, 70]
},
"Late": {
"lifespan": [190, 210],
"health": [3000, 3800],
"energy": [2800, 3500],
"luck": [26, 36],
"insight": [34, 44],
"basestrength": [48, 60],
"basewillpower": [44, 55],
"atk": [480, 580],
"def": [80, 110],
"crit": [22, 30],
"critres": [22, 30],
"agility": [55, 70],
"martialArts": [72, 90],
"spiritualRoot": [65, 85]
}
},
"Foundation Establishment Realm": {
"Early": {
"lifespan": [220, 250],
"health": [4200, 5200],
"energy": [3800, 4600],
"luck": [28, 38],
"insight": [38, 50],
"basestrength": [55, 70],
"basewillpower": [50, 65],
"atk": [620, 750],
"def": [100, 135],
"crit": [25, 35],
"critres": [25, 35],
"agility": [65, 82],
"martialArts": [85, 110],
"spiritualRoot": [80, 105]
},
"Middle": {
"lifespan": [255, 290],
"health": [5400, 6800],
"energy": [4800, 5900],
"luck": [35, 48],
"insight": [48, 62],
"basestrength": [68, 85],
"basewillpower": [62, 78],
"atk": [760, 920],
"def": [130, 170],
"crit": [32, 45],
"critres": [32, 45],
"agility": [80, 100],
"martialArts": [105, 135],
"spiritualRoot": [100, 130]
},
"Late": {
"lifespan": [300, 350],
"health": [7000, 8800],
"energy": [6100, 7600],
"luck": [45, 60],
"insight": [60, 78],
"basestrength": [85, 105],
"basewillpower": [78, 95],
"atk": [930, 1120],
"def": [165, 215],
"crit": [40, 55],
"critres": [40, 55],
"agility": [98, 122],
"martialArts": [130, 165],
"spiritualRoot": [125, 160]
}
},
"Core Formation Realm": {
"Early": {
"lifespan": [380, 450],
"health": [9500, 12000],
"energy": [8500, 10500],
"luck": [50, 68],
"insight": [70, 90],
"basestrength": [110, 140],
"basewillpower": [100, 125],
"atk": [1250, 1550],
"def": [220, 290],
"crit": [48, 65],
"critres": [48, 65],
"agility": [120, 150],
"martialArts": [170, 215],
"spiritualRoot": [155, 200]
},
"Middle": {
"lifespan": [460, 550],
"health": [12500, 15800],
"energy": [11000, 13800],
"luck": [65, 85],
"insight": [88, 112],
"basestrength": [135, 170],
"basewillpower": [125, 155],
"atk": [1580, 1950],
"def": [280, 370],
"crit": [60, 80],
"critres": [60, 80],
"agility": [150, 185],
"martialArts": [210, 265],
"spiritualRoot": [195, 245]
},
"Late": {
"lifespan": [560, 700],
"health": [16500, 21000],
"energy": [14500, 18000],
"luck": [80, 105],
"insight": [110, 140],
"basestrength": [165, 210],
"basewillpower": [155, 190],
"atk": [1980, 2450],
"def": [360, 470],
"crit": [75, 100],
"critres": [75, 100],
"agility": [185, 230],
"martialArts": [260, 330],
"spiritualRoot": [240, 300]
}
},
"Nascent Soul Realm": {
"Early": {
"lifespan": [800, 1200],
"health": [24000, 31000],
"energy": [21000, 27000],
"luck": [95, 125],
"insight": [130, 170],
"basestrength": [220, 280],
"basewillpower": [200, 255],
"atk": [2700, 3400],
"def": [480, 620],
"crit": [90, 120],
"critres": [90, 120],
"agility": [240, 300],
"martialArts": [340, 430],
"spiritualRoot": [290, 370]
},
"Middle": {
"lifespan": [1300, 1800],
"health": [32000, 42000],
"energy": [28000, 36000],
"luck": [120, 160],
"insight": [165, 215],
"basestrength": [275, 350],
"basewillpower": [255, 320],
"atk": [3500, 4400],
"def": [610, 790],
"crit": [115, 150],
"critres": [115, 150],
"agility": [300, 375],
"martialArts": [430, 540],
"spiritualRoot": [360, 460]
},
"Late": {
"lifespan": [2000, 3000],
"health": [45000, 60000],
"energy": [39000, 52000],
"luck": [155, 210],
"insight": [210, 270],
"basestrength": [350, 440],
"basewillpower": [320, 400],
"atk": [4600, 5800],
"def": [780, 1000],
"crit": [145, 190],
"critres": [145, 190],
"agility": [380, 480],
"martialArts": [550, 700],
"spiritualRoot": [450, 580]
}
}
}>>
<<set $gameVersion = 0.16>>
<</widget>>
<<widget "GameUpdateWidget-017a">>
<<set $regionEvent = {
active: false,
id: null,
x: null,
y: null,
duration: 0
}>>
<</widget>>
<<widget "GameUpdateWidget-018">>
<<include Items>>
<<include Potions>>
<<include PotionRecipes>>
<<include MerchantItems>>
<<include PlayerBeasts>>
<</widget>>
<<widget "GameUpdateWidget-019">>
<<include PlayerBeasts>>
<<include MerchantItems>>
<</widget>><<widget "updateDestinyStats">>
<<set $destinyatk = 0>>
<<set $destinydef = 0>>
<<set $destinycrit = 0>>
<<set $destinycritres = 0>>
<<set $destinyagility = 0>>
<<set $destinymartialArts = 0>>
<<set $destinyspiritualRoot = 0>>
<<set $righteousreputation = 0>>
<<set $demonicreputation = 0>>
<<set $destinylifespan = 0>>
<<set $destinyenergy = 0>>
<<set $destinyhealth = 0>>
<<for _d range $playerDestiny>>
<<if _d.destinyatk>> <<set $destinyatk += _d.destinyatk>> <</if>>
<<if _d.destinydef>> <<set $destinydef += _d.destinydef>> <</if>>
<<if _d.destinycrit>> <<set $destinycrit += _d.destinycrit>> <</if>>
<<if _d.destinycritres>> <<set $destinycritres += _d.destinycritres>> <</if>>
<<if _d.destinyagility>> <<set $destinyagility += _d.destinyagility>> <</if>>
<<if _d.destinymartialArts>> <<set $destinymartialArts += _d.destinymartialArts>> <</if>>
<<if _d.destinyspiritualRoot>> <<set $destinyspiritualRoot += _d.destinyspiritualRoot>> <</if>>
<<if _d.righteousreputation>> <<set $righteousreputation += _d.righteousreputation>> <</if>>
<<if _d.demonicreputation>> <<set $demonicreputation += _d.demonicreputation>> <</if>>
<<if _d.destinylifespan>> <<set $destinylifespan += _d.destinylifespan>> <</if>>
<<if _d.destinyenergy>> <<set $destinyenergy += _d.destinyenergy>> <</if>>
<<if _d.destinyhealth>> <<set $destinyhealth += _d.destinyhealth>> <</if>>
<</for>>
<<set $atk = $baseatk + $destinyatk>>
<<set $def = $basedef + $destinydef>>
<<set $crit = $basecrit + $destinycrit>>
<<set $critres = $basecritres + $destinycritres>>
<<set $agility = $baseagility + $destinyagility>>
<<set $martialArts = $basemartialArts + $destinymartialArts>>
<<set $spiritualRoot = $basespiritualRoot + $destinyspiritualRoot>>
<<set $maxlifespan to $basemaxlifespan + $destinylifespan>>
<<set $maxhealth to $basemaxhealth + $destinyenergy>>
<<set $maxenergy to $basemaxenergy + $destinyhealth>>
<<set $health = $maxhealth>>
<<set $energy = $maxenergy>>
<</widget>>
/* === UNIQUE CONSTITUTION GENERATION (xianxia style, every combo = different name) === */
<<widget "ConstitutionCalc">>
<<if $playerDestiny.length !== 3>>
<<set $constitutionName to "Incomplete Fate">>
<<set $constitutionDesc to "The Heavenly Dao cannot form your body. Exactly three destinies must converge before a true constitution can awaken.">>
<<else>>
/* Gather essences */
<<set _essences to []>>
<<for _d range $playerDestiny>>
<<set _essences.push(_d.essence)>>
<</for>>
/* Sort for stable keys */
<<set _sorted to _essences.sort()>>
<<set _key to _sorted.join("-")>>
/* ================================= */
/* LEGENDARY 3-DESTINY PHYSIQUES */
/* ================================= */
<<if _key === "Demonic-Demonic-Mind">>
<<set $constitutionName to "Abyssal Soul Devouring Physique">>
<<elseif _key === "Heaven-Heaven-Spirit">>
<<set $constitutionName to "Saintly Celestial Spirit Body">>
<<elseif _key === "Beast-Earth-Martial">>
<<set $constitutionName to "Primordial Titan War Body">>
<<elseif _key === "Fire-Heaven-Spirit">>
<<set $constitutionName to "Vermilion Phoenix Immortal Body">>
/* ================================= */
/* ELEMENTAL BODIES */
/* ================================= */
<<elseif _essences.includes("Fire") and _essences.includes("Ice")>>
<<set $constitutionName to "Primordial Yin-Yang Body">>
<<elseif _essences.includes("Fire")>>
<<set $constitutionName to "Blazing Vermilion Flame Physique">>
<<elseif _essences.includes("Ice")>>
<<set $constitutionName to "Frozen Jade Spirit Body">>
/* ================================= */
/* DEMONIC PATH */
/* ================================= */
<<elseif _essences.includes("Demonic")>>
<<set $constitutionName to "Nether Demon Devouring Body">>
/* ================================= */
/* HEAVENLY PATH */
/* ================================= */
<<elseif _essences.includes("Heaven")>>
<<set $constitutionName to "Heavenly Dao Blessed Physique">>
/* ================================= */
/* MARTIAL PATH */
/* ================================= */
<<elseif _essences.includes("Martial")>>
<<set $constitutionName to "Asura Martial War Body">>
/* ================================= */
/* BEAST PATH */
/* ================================= */
<<elseif _essences.includes("Beast")>>
<<set $constitutionName to "Ancient Beast Blood Physique">>
/* ================================= */
/* EARTH / BODY PATH */
/* ================================= */
<<elseif _essences.includes("Earth") or _essences.includes("Body")>>
<<set $constitutionName to "Titan Stone Physique">>
/* ================================= */
/* SPIRIT PATH */
/* ================================= */
<<elseif _essences.includes("Spirit")>>
<<set $constitutionName to "Celestial Spirit Vessel">>
/* ================================= */
/* FALLBACK */
/* ================================= */
<<else>>
<<set $constitutionName to "Myriad Dao Cultivation Body">>
<</if>>
/* ================================= */
/* PREFIX SYSTEM */
/* ================================= */
<<set _prefix to "">>
<<if $destinyspiritualRoot gte 15>>
<<set _prefix to "Heaven-Blessed ">>
<<elseif $demonicreputation gte 15>>
<<set _prefix to "Forbidden ">>
<<elseif $righteousreputation gte 15>>
<<set _prefix to "Saintly ">>
<</if>>
<<set $constitutionName to _prefix + $constitutionName>>
/* ================================= */
/* DESCRIPTION */
/* ================================= */
<<set $constitutionDesc to "Your meridians collapse and reform as the Heavenly Dao reshapes your body. The convergence of three destinies forges the " + $constitutionName >>
<</if>>
<</widget>>
<<widget "cultivationStatus">>
$cultivationStage $cultivationRealm
<</widget>>
<<widget "EnergyRecovery">>
<<if passage() is "Map|Region1">>
<<if $turns > $lastRecoveryTurn>>
<<set _EnergyRecovered = Math.round($maxenergy * $energyRecovery)>>
<<set $energy += _EnergyRecovered>>
<<if $energy > $maxenergy>><<set $energy = $maxenergy>><</if>>
<</if>>
<</if>>
<</widget>>
<<widget "HealthRecovery">>
<<if passage() is "Map|Region1">>
<<if $turns > $lastRecoveryTurn>>
<<set _HealthRecovered = Math.round($maxhealth * $healthRecovery)>>
<<set $health += _HealthRecovered>>
<<if $health > $maxhealth>><<set $health = $maxhealth>><</if>>
<</if>>
<</if>>
<</widget>>
<<widget "StatsRecovery">>
<<EnergyRecovery>>
<<HealthRecovery>>
<<set $lastRecoveryTurn = $turns>>
<</widget>>
<<widget "TurnsAge">>
/* Use State.variables to ensure we are looking at the exact same data the JS is touching */
<<if $turns gte $turnsPerYear>>
<<set $lifespan += 1>>
<<set $turns = 0>>
<<set _zodiacs to ["Rat", "Ox", "Tiger", "Rabbit", "Dragon", "Snake", "Horse", "Goat", "Monkey", "Rooster", "Dog", "Pig"]>>
<<set $currentZodiac to _zodiacs[$lifespan % 12]>>
<div class="age-announcement">
A year has passed. You are now $lifespan years old. It is the Year of the $currentZodiac.
</div>
<<if $known_npc_list and $known_npc_list.length gt 0>>
<<for _i = 0; _i lt $known_npc_list.length; _i++>>
<<set _loopNPC to $known_npc_list[_i]>>
<<if !_loopNPC.isDead>>
/* Increment their current age */
<<set _loopNPC.NPClifespan += 1>>
/* Check against their max */
<<if _loopNPC.NPClifespan gt _loopNPC.NPCmaxlifespan>>
<<set _loopNPC.isDead to true>>
<<set _loopNPC.deathCause = "old_age">>
<<set _loopNPC.killedByPlayer = false>>
<<set _loopNPC.killedInRevenge = false>>
<<set _loopNPC.deathGrudgeType = null>>
<<set _loopNPC.deathGrudgeVictim = null>>
<</if>>
<</if>>
<</for>>
<</if>>
<</if>>
<<set $pe to 0>>
<<set $p to 0>>
<</widget>>
<<widget "MapRender">>
<<set $passage to passage()>>
<<set _tileSize = 50>>
<<set _x = $playerX * _tileSize>>
<<set _y = $playerY * _tileSize>>
<<if _x == 0>><<set _x = 1>><</if>>
<<if _y == 0>><<set _y = 1>><</if>>
<<if $activeSideMission neq null>>
<<set _sideMX = $activeSideMission.missionCordX * _tileSize>>
<<set _sideMY = $activeSideMission.missionCordY * _tileSize>>
<</if>>
<div id="map-container">
<<if $MapRegion is "Region1">>
<img src="images/Story/Region1map.jpg" alt="Region 1 Map" class="map-region1">
<<elseif $MapRegion is "Region2">>
<img src="images/Story/Region2map.jpg" alt="Region 2 Map" class="map-region2">
<</if>>
<<print '<div class="player-icon" style="left: ' + _x + 'px; top: ' + _y + 'px;"></div>'>>
<<if $SideMissionStatus == "accepted">>
<<print '<div class="sidemission-icon" style="left: ' + _sideMX + 'px; top: ' + _sideMY + 'px;"></div>'>>
<</if>>
<<if $regionEvent.active>>
<<set _eventX = $regionEvent.x * _tileSize>>
<<set _eventY = $regionEvent.y * _tileSize>>
<<print '<div class="random-event-icon" style="left: ' + _eventX + 'px; top: ' + _eventY + 'px;"></div>'>>
<</if>>
<<if $storyEvent.active>>
<<set _eventX = $storyEvent.x * _tileSize>>
<<set _eventY = $storyEvent.y * _tileSize>>
<<print '<div class="story-event-icon" style="left: ' + _eventX + 'px; top: ' + _eventY + 'px;"></div>'>>
<</if>>
</div>
<</widget>>
<<widget "MissionNotification">>
<<if $activeSideMission neq null>>
<<if $playerX eq $activeSideMission.missionCordX and $playerY eq $activeSideMission.missionCordY>>
<span class="mission">You're on your mission location!</span>
<<link "Go!" "Mission|Region1">>
<</link>>
<</if>>
<</if>>
<</widget>>
<<widget "Movement">>
<<TurnsAge>>
<div id="movement-controls">
<<if $playerY > 2>>
<<link "↑ North">>
<<set $playerY -= 1>>
<<set $turns += 1>>
<<run localStorage.setItem("playerX", $playerX)>>
<<run localStorage.setItem("playerY", $playerY)>>
<<run localStorage.setItem("turns", $turns)>>
<<replace "#movement-controls">><<Movement>><</replace>>
<<replace "#map-container">><<MapRender>><</replace>>
<<replace "#event-container">><<RegionEvents>><<NpcPosition>><<MortalRealm>><<TurnsAge>><<MissionNotification>><</replace>>
<</link>>
<</if>>
<<if $playerY < 13>>
<<link "↓ South">>
<<set $playerY += 1>>
<<set $turns += 1>>
<<run localStorage.setItem("playerX", $playerX)>>
<<run localStorage.setItem("playerY", $playerY)>><<run localStorage.setItem("turns", $turns)>>
<<replace "#movement-controls">><<Movement>><</replace>>
<<replace "#map-container">><<MapRender>><</replace>>
<<replace "#event-container">><<RegionEvents>><<NpcPosition>><<MortalRealm>><<TurnsAge>><<MissionNotification>><</replace>>
<</link>>
<</if>>
<<if $playerX > 0>>
<<link "← West">>
<<set $playerX -= 1>>
<<set $turns += 1>>
<<run localStorage.setItem("playerX", $playerX)>>
<<run localStorage.setItem("playerY", $playerY)>><<run localStorage.setItem("turns", $turns)>>
<<replace "#movement-controls">><<Movement>><</replace>>
<<replace "#map-container">><<MapRender>><</replace>>
<<replace "#event-container">><<RegionEvents>><<NpcPosition>><<MortalRealm>><<TurnsAge>><<MissionNotification>><</replace>>
<</link>>
<</if>>
<<if $playerX < 11>>
<<link "→ East">>
<<set $playerX += 1>>
<<set $turns += 1>>
<<run localStorage.setItem("playerX", $playerX)>>
<<run localStorage.setItem("playerY", $playerY)>><<run localStorage.setItem("turns", $turns)>>
<<replace "#movement-controls">><<Movement>><</replace>>
<<replace "#map-container">><<MapRender>><</replace>>
<<replace "#event-container">><<RegionEvents>><<NpcPosition>><<MortalRealm>><<TurnsAge>><<MissionNotification>><</replace>>
<</link>>
<</if>>
</div>
<</widget>>
<<widget "statusCondition">>
<<showmeter "health">>
<<updatemeter "health" `$health / $maxhealth`>>
<<showmeter "energy">>
<<updatemeter "energy" `$energy / $maxenergy`>>
<div class="status">
<!-- HEALTH STATUS -->
<<if $health <= 0.1 * $maxhealth>>
<p><span class="wounded">⚠ You are on the brink of death!</span></p>
<<elseif $health <= 0.25 * $maxhealth>>
<p><span class="wounded">You are gravely wounded.</span></p>
<<elseif $health <= 0.5 * $maxhealth>>
<p><span class="wounded">You're bleeding and in pain.</span></p>
<<elseif $health <= 0.75 * $maxhealth>>
<p><span class="wounded">You're slightly injured.</span></p>
<<else>>
<p><span class="healthy">You're in good health.</span></p>
<</if>>
<!-- ENERGY (QI) STATUS -->
<<if $energy <= 0.1 * $maxenergy>>
<p><span class="drained">⚠ Your qi is nearly depleted!</span></p>
<<elseif $energy <= 0.25 * $maxenergy>>
<p><span class="drained">Your inner energy is dangerously low.</span></p>
<<elseif $energy <= 0.5 * $maxenergy>>
<p><span class="drained">Your qi circulation is weak.</span></p>
<<elseif $energy <= 0.75 * $maxenergy>>
<p><span class="drained">You feel a drain on your energy.</span></p>
<<else>>
<p><span class="focused">Your qi flows steadily.</span></p>
<</if>>
</div>
<</widget>>
<<widget "Breakthrough">>
<<set _realms = ["Mortal","Body Tempering Realm", "Meridian Awakening Realm", "Qi Condensation Realm", "Foundation Establishment Realm", "Core Formation Realm", "Nascent Soul Realm"]>>
<<set _stages = ["Early", "Middle", "Late"]>>
<<set _realmIndex = _realms.indexOf($cultivationRealm)>>
<<set _stageIndex = _stages.indexOf($cultivationStage)>>
<<set _baseExp = 1000>>
<<set _requiredExp = _baseExp * Math.pow(_realmIndex + 1, 2) * (_stageIndex + 1)>>
<<set _progress = Math.min(100, Math.round(($exp / _requiredExp) * 100))>>
<div style="border: 1px solid #777; padding: 1em; width: 90%; background: rgba(255,255,255,0.05); border-radius: 10px; font-family: 'serif'; color: #e0e0e0;">
<h3 style="margin: 0 0 0.5em 0; color: #8ff;">🧘 Cultivation Status</h3>
<p><strong>Stage:</strong> $cultivationStage<br>
<strong>Realm:</strong> $cultivationRealm</p>
<p><strong>EXP:</strong> <<print $exp.toFixed(1)>> / <<print _requiredExp>> (<<print _progress>>%)</p>
<div style="width: 100%; height: 20px; background: #333; border: 1px solid #666; border-radius: 5px; margin-bottom: 1em;">
<div style="width: <<print _progress>>%; height: 100%; background: linear-gradient(to right, #00f2ff, #4dffbf); border-radius: 5px;"></div>
</div>
<!-- Breakthrough Button -->
<<if $exp >= _requiredExp>>
<<link "🌌 Attempt Breakthrough" "Breakthrough1">><<set $exp to $exp - _requiredExp>> <</link>>
<<else>>
<p style="color:#ff6b6b; font-weight:bold; margin-top:20px;">
Not enough EXP to attempt breakthrough yet.
</p>
<</if>>
<</widget>>
<<widget "UpdatePlayerStats">>
<<set _multiplier to $args[0]>>
<<set $basemaxlifespan = Math.round($basemaxlifespan * _multiplier)>>
<<set $basemaxhealth = Math.round($basemaxhealth * _multiplier)>>
<<set $basemaxenergy = Math.round($basemaxenergy * _multiplier)>>
<<set $baseluck = Math.round($baseluck * _multiplier)>>
<<set $baseinsight = Math.round($baseinsight * _multiplier)>>
<<set $basebasestrength = Math.round($basebasestrength * _multiplier)>>
<<set $basebasewillpower = Math.round($basebasewillpower * _multiplier)>>
<<set $baseatk = Math.round($baseatk * _multiplier)>>
<<set $basedef = Math.round($basedef * _multiplier)>>
<<set $baseagility = Math.round($baseagility * _multiplier)>>
<<set $basemartialArts = Math.round($basemartialArts * _multiplier)>>
<<set $basespiritualRoot = Math.round($basespiritualRoot * _multiplier)>>
<</widget>>
<<widget "BreakthroughEvent">>
<<set _breakthroughOutcome = random(1, 100)>>
<<set _cancel = 0>>
<div class="outcome-box">
<<if _breakthroughOutcome lte 12>>
<!-- Qi Deviation - slightly rarer -->
<img src="images/Story/qideviation.png" width="60%" style="border-radius:12px; box-shadow:0 0 20px #ff6b6b;">
<p class="outcome-failure"><b>Qi Deviation!</b><br>Your meridians rebel in chaos. Blood sprays from your mouth as heavenly punishment strikes.</p>
<<set $health = Math.floor($health * 0.45)>>
<<set $energy = Math.floor($energy * 0.45)>>
<p>Your life hangs by a thread. <span class="red">Recover and try again.</span></p>
<<set _cancel = 1>>
<<LogEvent "cultivation" "Qi Deviation" "Your breakthrough attempt failed spectacularly. Your health and energy are heavily damaged." 2>>
<<elseif _breakthroughOutcome gt 12 and _breakthroughOutcome lte 78>>
<!-- Normal Breakthrough -->
<img src="images/Story/normal.png" width="60%" style="border-radius:12px; box-shadow:0 0 20px #66bb6a;">
<p class="outcome-success"><b>Breakthrough Successful!</b><br>Your qi surges forward like a calm river breaking a dam.</p>
<<set _multiplier = 1.28 + Math.random() * 0.12>> /* 1.28x ~ 1.40x */
<<else>>
<!-- Enlightenment - better rewards -->
<img src="images/Story/enlightenment.png" width="60%" style="border-radius:12px; box-shadow:0 0 20px gold;">
<p class="outcome-enlightenment"><b>Enlightenment Descends!</b><br>The Dao opens its eyes upon you. Power floods your body!</p>
<<set _multiplier = 1.45 + Math.random() * 0.15>> /* 1.45x ~ 1.60x */
<</if>>
<<if _cancel eq 1>>
<<link "Forfeit Attempt" "Breakthrough">>
<<set $exp -= random(150, 800)>>
<</link>>
<<else>>
<<set _realmIndex = $cultivationRealms.indexOf($cultivationRealm)>>
<<set _stageIndex = $cultivationStages.indexOf($cultivationStage)>>
<<run _stageIndex++>>
<<if _stageIndex gte $cultivationStages.length>>
<<set _stageIndex = 0>>
<<set _realmIndex++>>
<<if _realmIndex gte $cultivationRealms.length>>
<p class="outcome-enlightenment">You have reached the peak of known cultivation!</p>
<<LogEvent "cultivation" "Peak of Cultivation" "You have reached the absolute peak of known cultivation." 5>>
<<else>>
<<set $cultivationRealm = $cultivationRealms[_realmIndex]>>
<<set $cultivationStage = $cultivationStages[_stageIndex]>>
<p class="outcome-success">New Realm Achieved!<br><b>$cultivationRealm</b> ($cultivationStage)</p>
<</if>>
<<else>>
<<set $cultivationStage = $cultivationStages[_stageIndex]>>
<p class="outcome-success">New Stage Achieved!<br><b>$cultivationStage</b> $cultivationRealm</p>
<</if>>
<<if _cancel eq 0>>
<<link "Return" "Breakthrough">>
<!-- === MAIN STAT UPDATE - This is the key improvement === -->
<<UpdatePlayerStats _multiplier>>
<!-- Constitution bonus on breakthrough (very important for not falling behind) -->
<<if $constitutionName && $constitutionName.includes("Vermilion") || $constitutionName.includes("Blazing") || $constitutionName.includes("Flame")>>
<<set _constBonus = 1.12>> /* 12% extra for your flame physique */
<<elseif $constitutionName && $constitutionName.includes("Saintly") || $constitutionName.includes("Heaven")>>
<<set _constBonus = 1.10>>
<<else>>
<<set _constBonus = 1.06>>
<</if>>
<<set _finalMultiplier = _multiplier * _constBonus>>
/* Optional: extra boost when entering new realm */
<<if _stageIndex eq 0>>
<<set _finalMultiplier = _finalMultiplier * 1.18>>
<</if>>
<<set $playerPower = $power[$cultivationRealm][$cultivationStage] || 0>>
<<set _desc = "Breakthrough to " + $cultivationStage + " " + $cultivationRealm + ". Power surges dramatically.">>
<<LogEvent "breakthrough" "Advancement" _desc 4>>
<</link>>
<</if>>
<</if>>
</div>
<</widget>>
<<widget "HealthBar">>
<<if $currenthealth eq $maxhealth>><img src="Images/Icons/health10.png" width=200 /><<elseif $currenthealth gte ($maxhealth*0.9)>><img src="Images/Icons/health9.png" width=200 /><<elseif $currenthealth gte ($maxhealth*0.8)>><img src="Images/Icons/health8.png" width=200 /><<elseif $currenthealth gte ($maxhealth*0.7)>><img src="Images/Icons/health7.png" width=200 /><<elseif $currenthealth gte ($maxhealth*0.6)>><img src="Images/Icons/health6.png" width=200 /><<elseif $currenthealth gte ($maxhealth*0.5)>><img src="Images/Icons/health5.png" width=200 /><<elseif $currenthealth gte ($maxhealth*0.4)>><img src="Images/Icons/health4.png" width=200 /><<elseif $currenthealth gte ($maxhealth*0.3)>><img src="Images/Icons/health3.png" width=200 /><<elseif $currenthealth gte ($maxhealth*0.2)>><img src="Images/Icons/health2.png" width=200 /><<elseif $currenthealth gte ($maxhealth*0.1)>><img src="Images/Icons/health1.png" width=200 /><<else>><img src="Images/Icons/health0.png" width=200 /><</if>>
<</widget>>
<<widget "HeaderFooter">>
<<if $energy gt $maxenergy>> <<set $energy = $maxenergy>><</if>>
<<if $energy lt 0>> <<set $energy = 0>><</if>>
<<if $health gt $maxhealth>> <<set $health = $maxhealth>><</if>>
<</widget>>
<<widget "FameUpdater">>
<<set $totalPCrighteousreputation to $PCrighteousreputation + $righteousreputation>>
<<set $totalPCdemonicreputation to $PCdemonicreputation + $demonicreputation>>
<<set $totalFame to ($fame + $sectFame + $cultivationFame + $combatFame)>>
<</widget>>
<<widget "StatsUpdater">>
/* Base stats + destiny bonuses */
<<set $atk = $baseatk + $destinyatk + ($basestrength*0.5) + $passiveatk>>
<<set $def = $basedef + $destinydef + $passivedef>>
<<set $crit = $basecrit + $destinycrit + $passivecrit>>
<<set $critres = $basecritres + $destinycritres + $passivecritres>>
<<set $agility = $baseagility + $destinyagility + $passiveagility>>
<<set $martialArts = $basemartialArts + $destinymartialArts>>
<<set $spiritualRoot = $basespiritualRoot + $destinyspiritualRoot>>
/* Core stats */
<<set $luck = $baseluck>>
<<set $insight = $baseinsight>>
<<set $evadescore = Math.round(($agility * 2) + ($insight * 1.5) + ($luck * 0.5))>>
/* Max stats */
<<set $maxlifespan = $basemaxlifespan + $destinylifespan>>
<<set $maxhealth = Math.round($basemaxhealth + $destinyhealth)>>
<<set $maxenergy = Math.round($basemaxenergy + $destinyenergy)>>
/* ==================== EQUIPMENT BONUSES ==================== */
/* Reset equipment bonuses */
<<set $equipatk to 0>>
<<set $equipdef to 0>>
<<set $equipcrit to 0>>
<<set $equipcritres to 0>>
<<set $equipagility to 0>>
<<set $equipwillpower to 0>>
<<set $equipstrength to 0>>
<<set $equiparmor to 0>>
<<set $equipinsight to 0>>
/* Robe Bonuses */
<<if $equippedRobe neq null>>
<<if $equippedRobe.stats neq null>>
<<if $equippedRobe.stats.atk neq null>><<set $equipatk += $equippedRobe.stats.atk>><</if>>
<<if $equippedRobe.stats.def neq null>><<set $equipdef += $equippedRobe.stats.def>><</if>>
<<if $equippedRobe.stats.crit neq null>><<set $equipcrit += $equippedRobe.stats.crit>><</if>>
<<if $equippedRobe.stats.critres neq null>><<set $equipcritres += $equippedRobe.stats.critres>><</if>>
<<if $equippedRobe.stats.agility neq null>><<set $equipagility += $equippedRobe.stats.agility>><</if>>
<<if $equippedRobe.stats.willpower neq null>><<set $equipwillpower += $equippedRobe.stats.willpower>><</if>>
<<if $equippedRobe.stats.strength neq null>><<set $equipstrength += $equippedRobe.stats.strength>><</if>>
<<if $equippedRobe.stats.armor neq null>><<set $equiparmor += $equippedRobe.stats.armor>><</if>>
<<if $equippedRobe.stats.insight neq null>><<set $equipinsight += $equippedRobe.stats.insight>><</if>>
<</if>>
<</if>>
/* Underwear Bonuses */
<<if $equippedUnderwear neq null>>
<<if $equippedUnderwear.stats neq null>>
<<if $equippedUnderwear.stats.atk neq null>><<set $equipatk += $equippedUnderwear.stats.atk>><</if>>
<<if $equippedUnderwear.stats.def neq null>><<set $equipdef += $equippedUnderwear.stats.def>><</if>>
<<if $equippedUnderwear.stats.crit neq null>><<set $equipcrit += $equippedUnderwear.stats.crit>><</if>>
<<if $equippedUnderwear.stats.critres neq null>><<set $equipcritres += $equippedUnderwear.stats.critres>><</if>>
<<if $equippedUnderwear.stats.agility neq null>><<set $equipagility += $equippedUnderwear.stats.agility>><</if>>
<<if $equippedUnderwear.stats.willpower neq null>><<set $equipwillpower += $equippedUnderwear.stats.willpower>><</if>>
<<if $equippedUnderwear.stats.strength neq null>><<set $equipstrength += $equippedUnderwear.stats.strength>><</if>>
<<if $equippedUnderwear.stats.armor neq null>><<set $equiparmor += $equippedUnderwear.stats.armor>><</if>>
<<if $equippedUnderwear.stats.insight neq null>><<set $equipinsight += $equippedUnderwear.stats.insight>><</if>>
<</if>>
<</if>>
/* Weapon Bonuses */
<<if $equippedWeapon neq null>>
<<if $equippedWeapon.stats neq null>>
<<if $equippedWeapon.stats.atk neq null>><<set $equipatk += $equippedWeapon.stats.atk>><</if>>
<<if $equippedWeapon.stats.def neq null>><<set $equipdef += $equippedWeapon.stats.def>><</if>>
<<if $equippedWeapon.stats.crit neq null>><<set $equipcrit += $equippedWeapon.stats.crit>><</if>>
<<if $equippedWeapon.stats.critres neq null>><<set $equipcritres += $equippedWeapon.stats.critres>><</if>>
<<if $equippedWeapon.stats.agility neq null>><<set $equipagility += $equippedWeapon.stats.agility>><</if>>
<<if $equippedWeapon.stats.willpower neq null>><<set $equipwillpower += $equippedWeapon.stats.willpower>><</if>>
<<if $equippedWeapon.stats.strength neq null>><<set $equipstrength += $equippedWeapon.stats.strength>><</if>>
<<if $equippedWeapon.stats.armor neq null>><<set $equiparmor += $equippedWeapon.stats.armor>><</if>>
<<if $equippedWeapon.stats.insight neq null>><<set $equipinsight += $equippedWeapon.stats.insight>><</if>>
<</if>>
<</if>>
/* Accessories Bonuses (3 slots) */
<<if $equippedAccessories neq null>>
<<for _i to 0; _i lt 3; _i++>>
<<set _acc to $equippedAccessories[_i]>>
<<if _acc neq null>>
<<if _acc.stats neq null>>
<<if _acc.stats.atk neq null>><<set $equipatk += _acc.stats.atk>><</if>>
<<if _acc.stats.def neq null>><<set $equipdef += _acc.stats.def>><</if>>
<<if _acc.stats.crit neq null>><<set $equipcrit += _acc.stats.crit>><</if>>
<<if _acc.stats.critres neq null>><<set $equipcritres += _acc.stats.critres>><</if>>
<<if _acc.stats.agility neq null>><<set $equipagility += _acc.stats.agility>><</if>>
<<if _acc.stats.willpower neq null>><<set $equipwillpower += _acc.stats.willpower>><</if>>
<<if _acc.stats.strength neq null>><<set $equipstrength += _acc.stats.strength>><</if>>
<<if _acc.stats.armor neq null>><<set $equiparmor += _acc.stats.armor>><</if>>
<<if _acc.stats.insight neq null>><<set $equipinsight += _acc.stats.insight>><</if>>
<</if>>
<</if>>
<</for>>
<</if>>
/* ==================== FINAL STATS WITH EQUIPMENT ==================== */
<<set $atk += $equipatk>>
<<set $def += $equipdef>>
<<set $crit += $equipcrit>>
<<set $critres += $equipcritres>>
<<set $agility += $equipagility>>
<<set $willpower = $basewillpower + $equipwillpower>> /* Add willpower if you have $willpower stat */
<<set $strength = $basestrength + $equipstrength>> /* Add strength if needed */
<<set $armor = $equiparmor>> /* New armor stat if you use it */
<<set $insight += $equipinsight>>
/* Recalculate evade if affected */
<<set $evadescore = Math.round(($agility * 2) + ($insight * 1.5) + ($luck * 0.5))>>
<</widget>>
<<widget "MissionFinish">>
<<if $MissionType eq "sect">>
<<set $ContributionPoints to ($ContributionPoints += $activeSideMission.reward)>>
<<set $CurrentPcSectReputation to ($CurrentPcSectReputation += $activeSideMission.gainFame)>>
<<set $sectFavor to ($sectFavor += $activeSideMission.favor)>>
<span class="mission"> <i>✓ Mission completed successfully.</i> </span>
<<link "Go back" $passage>><<set $pe to 0>><<set $activeSideMission to null>><<set $SideMissionStatus to null>><<set $turns += 1>><<set $npcFinished to null>><<set $cumcount = 0>><</link>>
<<else>>
<span class="mission"> <i>✓ Mission completed successfully.</i> </span>
<<set $gold to ($gold += $activeSideMission.reward)>>
<<set $fame to ($fame += $activeSideMission.gainFame)>>
<<link "Go back" $passage>><<set $pe to 0>><<set $SideMissionStatus to null>><<set $activeSideMission to null>><<set $turns += 1>><<set $npcFinished to null>><<set $cumcount = 0>><</link>>
<</if>>
<</widget>>
<<widget "MissionFinishAuto">>
<<if $MissionType eq "sect">>
<<set $ContributionPoints to ($ContributionPoints += $activeSideMission.reward)>>
<<set $CurrentPcSectReputation to ($CurrentPcSectReputation += $activeSideMission.gainFame)>>
<<set $sectFavor to ($sectFavor += $activeSideMission.favor)>>
<span class="mission"> <i>✓ Mission completed successfully.</i> </span>
<<set $pe to 0>><<set $activeSideMission to null>><<set $SideMissionStatus to null>><<set $turns += 1>><<set $npcFinished to null>><<set $cumcount = 0>>
<<else>>
<span class="mission"> <i>✓ Mission completed successfully.</i> </span>
<<set $gold to ($gold += $activeSideMission.reward)>>
<<set $fame to ($fame += $activeSideMission.gainFame)>>
<<set $pe to 0>><<set $SideMissionStatus to null>><<set $activeSideMission to null>><<set $turns += 1>><<set $npcFinished to null>><<set $cumcount = 0>>
<</if>>
<</widget>>
<<widget "MissionFailed">>
<<if $MissionType eq "sect">>
<span class="mission"> <i>✗ Mission failed!</i> </span>
<<link "Go back" $passage>><<set $pe to 0>><<set $activeSideMission to null>><<set $SideMissionStatus to null>><<set $turns += 1>><<set $npcFinished to null>><<set $cumcount = 0>><</link>>
<<else>>
<span class="mission"> <i>✗ Mission failed!</i> </span>
<<link "Go back" $passage>><<set $pe to 0>><<set $SideMissionStatus to null>><<set $activeSideMission to null>><<set $turns += 1>><<set $npcFinished to null>><<set $cumcount = 0>><</link>>
<</if>>
<</widget>>
<<widget "PositionCheckSex">>
<<if $cumcount >= 3>>
<<set _roll = random(1, 100)>>
<<if _roll <= 25>>
<<set $npcFinished = true>>
<p>He suddenly groans and releases deep inside without warning!</p>
<</if>>
<<if not $npcFinished>>
<p>He's close. Where do you want him to finish?</p>
<<link "Inside">>
<p>You pull him deeper and feel him release inside you.</p>
<</link>>
<<link "Outside">>
<p>You pull back just in time — he spills over your stomach.</p>
<</link>>
<<link "On your back">>
<p>You drop to your knees, and he finishes across your back.</p>
<</link>>
<</if>>
<</if>>
<</widget>>
<!-- Portrait updater -->
<<widget "UpdatePortrait">>
<div class="portrait-container">
<<set _img to "images/Character/bare.jpg">>
<<if $equippedRobe.name neq "Naked State" and $equippedRobe.durability neq null>>
<<set _dur to $equippedRobe.durability>>
<<set _maxDur to $equippedRobe.maxDurability>>
<<if _dur gt (_maxDur * 0.5)>>
<<set _img to "images/Character/pristine.jpg">>
<<elseif _dur gt (_maxDur * 0.2)>>
<<set _img to "images/Character/torn.jpg">>
<<else>>
<<set _img to "images/Character/bare.jpg">>
<</if>>
<</if>>
<img @src="_img" class="portrait-img">
</div>
<</widget>>
<<widget "StatusPortrait">>
<div class="status-portrait-container">
<<set _img to "images/Character/bare.jpg">>
<<if $equippedRobe.name neq "Naked State" and $equippedRobe.durability neq null>>
<<set _dur to $equippedRobe.durability>>
<<set _maxDur to $equippedRobe.maxDurability>>
<<if _dur gt (_maxDur * 0.5)>>
<<set _img to "images/Character/pristine.jpg">>
<<elseif _dur gt (_maxDur * 0.2)>>
<<set _img to "images/Character/torn.jpg">>
<<else>>
<<set _img to "images/Character/bare.jpg">>
<</if>>
<</if>>
<img @src="_img" class="status-portrait-img">
</div>
<</widget>>
<!-- Arena Tournament Widget -->
??
<!--__________________________________________________________________________________________
_________________________ Rumours Widgets _________________________-->
<<widget "WorldRumours">>
/* 1. THE AGING PROCESS: Subtract 1 from any active event timers */
<<if $worldState.activeWar>>
<<set $worldState.activeWar.remaining -= 1>>
/* If timer hits 0, the war ends */
<<if $worldState.activeWar.remaining lte 0>>
<div class="rumour-event">
<strong>◎ Jianghu News ◎</strong><br>
The bloody conflict between the <<print $worldState.activeWar.sideA>> and <<print $worldState.activeWar.sideB>> has finally concluded. A fragile peace returns... for now.
</div>
<<set $worldState.activeWar to null>>
<</if>>
<</if>>
/* 2. TRIGGER NEW RUMOURS (20% chance) */
<<if random(1, 100) lte 20>>
<<set _rumourCategory to random(1, 100)>>
<<set _text to "">>
<<switch _rumourCategory>>
/* --- 1–20: SECT WAR LOGIC --- */
<<case 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20>>
<<if $worldState.activeWar>>
/* Report on the CURRENT war */
<<set _text to `The fields are stained red as the war between **$worldState.activeWar.sideA** and **$worldState.activeWar.sideB** enters another month. ($worldState.activeWar.remaining turns until exhaustion).`>>
<<else>>
/* Start a NEW war */
<<set _sects to ["Clear Sky Azure Dragon Pavilion", "Ghost King Netherworld Sect", "Five Elements Holy Land", "Profound Heaven Sword Alliance"].randomMany(2)>>
/* A war lasts between 1/2 year (12 turns) and 1.5 years (36 turns) */
<<set _duration to random(12, 36)>>
<<set $worldState.activeWar to {
sideA: _sects[0],
sideB: _sects[1],
remaining: _duration
}>>
<<if _sects.includes($playerSect)>>
<<set _text to `**URGENT:** Your sect, ${_sects.find(s => s === $playerSect)}, has declared war! The elders demand blood from the ${_sects.find(s => s !== $playerSect)}!`>>
<<else>>
<<set _text to `The **${_sects[0]}** and **${_sects[1]}** have officially begun a Great Sect War. The region is in chaos.`>>
<</if>>
<</if>>
/* --- 16–30: THE "BORN GENIUS" / SECT POLITICS --- */
<<case 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30>>
<<set _name to ["Young Master Xiao", "Fairy Lingyue", "Sword Madman Huo", "Ghost Hand Xue", "Elder Han's Bastard"].random()>>
<<set _sect to ["Heavenly Sword Sect", "Jade Pure Palace", "Blood Flame Clan"].random()>>
<<if _sect === $playerSect>>
<<set _text to [
`Whispers in the outer courts: **_name** has successfully refined a 'Heart-Severing Pill'. The screams from the dungeon have finally stopped.`,
`Internal politics: Your fellow disciple **_name** was found with a crippled cultivation base. The Elders are calling it 'meditation backfire,' but everyone saw the marks of a forbidden technique.`,
`Promotion: **_name** has been granted the title of Core Disciple. Three other candidates disappeared during the 'selection trial'.`
].random()>>
<<else>>
<<set _text to [
`The **_sect** is hunting for **_name**, a runaway disciple who allegedly stole a fragment of their foundational scripture. A bounty of 10,000 spirit stones—dead or alive.`,
`Travelers claim the **_sect** has blockaded the nearby mountain passes. They are 'testing' the spiritual roots of every traveler; those who fail are sent to the mines.`,
`Rumor has it **_name** of the **_sect** slaughtered an entire branch family of a vassal clan for a 'slight' to their dignity. The blood hasn't washed off the stones yet.`
].random()>>
<</if>>
/* --- 31–45: ANCIENT RUINS & DESOLATION --- */
<<case 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45>>
<<set _zone to ["Blood Sand Reach", "Hundred Sorrows Mountain"].random()>>
<<set _text to [
`The seal on **_zone** has fractured. A miasma of ancient resentment is drifting toward the mortal plains; three villages have already gone silent.`,
`Scouts returned from **_zone** with their eyes gouged out. They keep chanting about an 'Immortal's Grave' that isn't empty.`,
`The Righteous Path has established a perimeter around **_zone**. They claim it is for 'public safety,' but the wagon-loads of looted artifacts tell a different story.`,
`A pulse of dark energy erupted from **_zone**. The local wildlife has mutated, growing teeth of obsidian and a hunger for spiritual qi.`
].random()>>
/* --- 46–60: MARKET & THE COST OF POWER --- */
<<case 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60>>
<<set _text to [
"Spirit stone purity is dropping across the southern markets. Rumors suggest the Great Veins are being over-mined to fund the upcoming war.",
"The black market is flooded with 'Blood Essence' vials. Local graveyards have been desecrated, leading many to suspect a demonic sect is harvesting the dead.",
"A merchant caravan was found slaughtered near the border. Not a single spirit stone was taken—only the children's 'spiritual roots' were harvested.",
"The price of Foundation Establishment Pills has tripled. Small clans are selling their daughters into sect servitude just to afford a single chance at a breakthrough."
].random()>>
/* --- 61–100: GENERAL FLAVOR & OMINOUS MYSTERIES --- */
<<default>>
<<set _text to [
"A wandering cultivator was found hanging from the gates of a mortal city, his skin covered in forbidden seals. A warning from the Ghost King's men.",
"Old Man He from the fishing village says the river ran red for three hours yesterday. He saw shadows beneath the water that didn't belong to fish.",
"A group of rogue cultivators 'purified' a village of suspected plague. They burned it to the ground with the inhabitants still inside.",
"Eerie flutes are heard at night in the pine forests. Those who follow the music are found days later with their souls missing and their bodies intact.",
"A 'Saintess' has appeared in the slums, performing miracles. The local sect is preparing to 'arrest' her for heresy—or perhaps to steal her cultivation method.",
"The sky turned a bruised purple for ten heartbeats today. The birds fell dead from the trees, and the oxen refused to plow."
].random()>>
<</switch>>
/* 3. FINAL OUTPUT */
<<if _text neq "">>
<div class="rumour-event">
<strong>◎ Jianghu Whispers ◎</strong>
<<if _severity is "shocking">><span style="color: #c41e3a;"> (Shocking!)</span><</if>>
<<if $worldState.activeWar>><br><small><i>[STATE: War in Progress]</i></small><</if>>
<br>_text
</div>
<</if>>
<</if>>
<</widget>>
<<widget "TavernGossip">>
<div class="rumour-box" style="border-left: 3px solid #d4af37; padding-left: 10px; margin: 10px 0; background: rgba(255,255,255,0.05);">
<i style="color: #aaa;">You lean back and sharpen your senses, filtering through the clatter of chopsticks and the slurred boasts of drunken men...</i><br><br>
/* Call your existing logic */
<<WorldRumours>>
/* If WorldRumours didn't trigger (the 20% chance), give a default "quiet" message */
<<if _text eq "" or _text eq undefined>>
<span style="color: #888;">The conversations tonight are mundane—mostly complaints about the price of low-grade grain and local tax collectors.</span>
<</if>>
</div>
<</widget>>
<<widget "LogEvent">>
<<set _type to $args[0]>>
<<set _title to $args[1]>>
<<set _description to $args[2]>>
<<set _importance to $args[3] || 3>>
<<set _relatedNPC to $args[4] || null>>
<<set _relatedNPCName to $args[5] || null>>
<<set _entry = {
id: $nextJournalId,
turn: $turns || 0,
age: $lifespan,
type: _type,
title: _title,
description: _description,
importance: _importance,
relatedNPC: _relatedNPC,
relatedNPCName: _relatedNPCName,
location: $region,
timestamp: Date.now()
}>>
<<run $journalEntries.unshift(_entry)>>
<<set $nextJournalId += 1>>
/* Optional: limit journal size to prevent bloat (keep last 200 entries) */
<<if $journalEntries.length gt 200>>
<<run $journalEntries.pop()>>
<</if>>
<</widget>><<widget "GenerateGrudge">>
<<set _victim to $args[0]>>
<<set _action to $args[1]>>
<<set _avengerId to $args[2] || null>>
/* Determine who seeks revenge */
<<set _avenger to null>>
<<set _relationship to "">>
<<if _avengerId>>
<<set _avenger to $known_npc_list.find(function(n) { return n.id === _avengerId; })>>
<<else>>
/* Find a relative or close connection */
<<set _potentialAvengers to []>>
/* Check all known NPCs for relations to victim */
<<for _i = 0; _i lt $known_npc_list.length; _i++>>
<<set _npc to $known_npc_list[_i]>>
<<if _npc.id != _victim.id and !_npc.isDead>>
<<if _npc.relations.lovers and _npc.relations.lovers.includes(_victim.id)>>
<<set _potentialAvengers.push({npc: _npc, rel: "lover"})>>
<</if>>
<<if _npc.relations.spouses and _npc.relations.spouses.includes(_victim.id)>>
<<set _potentialAvengers.push({npc: _npc, rel: "spouse"})>>
<</if>>
<<if _npc.relations.parents and _npc.relations.parents.includes(_victim.id)>>
<<set _potentialAvengers.push({npc: _npc, rel: "child"})>>
<</if>>
<<if _npc.relations.children and _npc.relations.children.includes(_victim.id)>>
<<set _potentialAvengers.push({npc: _npc, rel: "parent"})>>
<</if>>
<<if _npc.relations.siblings and _npc.relations.siblings.includes(_victim.id)>>
<<set _potentialAvengers.push({npc: _npc, rel: "sibling"})>>
<</if>>
<<if _npc.relations.masters and _npc.relations.masters.includes(_victim.id)>>
<<set _potentialAvengers.push({npc: _npc, rel: "disciple"})>>
<</if>>
<<if _npc.relations.apprentices and _npc.relations.apprentices.includes(_victim.id)>>
<<set _potentialAvengers.push({npc: _npc, rel: "master"})>>
<</if>>
<</if>>
<</for>>
<<if _potentialAvengers.length gt 0>>
<<set _selected = _potentialAvengers.random()>>
<<set _avenger = _selected.npc>>
<<set _relationship = _selected.rel>>
<</if>>
<</if>>
<<if _avenger>>
/* Calculate severity based on action and victim's cultivation */
<<set _severity = 0>>
<<switch _action>>
<<case "rape">>
<<set _severity = 8 + Math.floor(Math.random() * 3)>>
<<set _avenger.depravity += 5>>
<<set $demonicreputation += 15>>
<<set $hypocrisyScore += 10>>
<<case "seduction">>
<<set _severity = 3 + Math.floor(Math.random() * 3)>>
<<set $sexFame += 5>>
<<case "murder">>
<<set _severity = 10>>
<<set $demonicreputation += 20>>
<<set $civilians_harmed += 1>>
<<case "humiliation">>
<<set _severity = 2 + Math.floor(Math.random() * 4)>>
<<set $fame -= 5>>
<<case "betrayal">>
<<set _severity = 5 + Math.floor(Math.random() * 3)>>
<<set $hypocrisyScore += 5>>
<</switch>>
/* Create grudge object */
<<set _grudge = {
id: Date.now() + "_" + random(0, 9999),
avengerId: _avenger.id,
avengerName: _avenger.fullname,
victimId: _victim.id,
victimName: _victim.fullname,
type: _action,
severity: _severity,
relationship: _relationship,
location: _victim.NPClocation,
triggered: false,
active: true,
hasGrudge: true,
timer: random(3, 7) /* turns before they act*/
}>>
<<run $activeGrudges.push(_grudge)>>
/* Update avenger's stats */
<<set _avenger.hasGrudge = true>>
<<set _avenger.grudgeTarget = "player">>
<<set _avenger.grudgeType = _action>>
/* Generate message for player */
<<set _grudgeMessage = "✦ A shadow stirs in " + _victim.NPClocation + ". " + _avenger.fullname + " seeks justice for what you did to " + _victim.fullname + "! ✦">>
<<set $lastGrudgeMessage = _grudgeMessage>>
<</if>>
<</widget>>
<<widget "CheckRevengeEvents">>
<<if def $activeGrudges and $activeGrudges.length gt 0>>
<<set _revengeTriggered to false>>
/* Using range to avoid index errors */
<<for _index, _grudge range $activeGrudges>>
<<if _grudge.active and !_grudge.triggered and !_revengeTriggered>>
<<set _grudge.timer -= 1>>
<<if _grudge.timer lte 0>>
<<set _avenger to $known_npc_list.find(function(n) { return n.id === _grudge.avengerId; })>>
<<if _avenger and !_avenger.isDead>>
/* High power NPCs can hunt you across regions! */
<<set _isPowerful to (_avenger.power gt 100)>>
<<set _locationMatch to (_avenger.NPClocation == $region or _grudge.location == $region or _isPowerful)>>
<<set _chance to 15 + (_grudge.severity * 5)>>
<<if _locationMatch>><<set _chance += 25>><</if>>
/* Debug: <<print "Checking grudge for " + _avenger.fullname + " Chance: " + _chance>> */
<<if random(1,100) lte _chance>>
<<set _revengeTriggered to true>>
<<set _grudge.triggered to true>>
<<set $currentRevengeGrudge to _grudge>>
<<set $encounterOriginPassage to passage()>>
<<goto "RevengeEncounter">>
<</if>>
<<else>>
/* If avenger died elsewhere, deactivate the grudge */
<<set _grudge.active to false>>
<</if>>
<</if>>
<</if>>
<</for>>
/* Cleanup: Periodically remove inactive grudges from the array */
<<set $activeGrudges to $activeGrudges.filter(function(g) { return g.active === true; })>>
<</if>>
<</widget>><<widget "setupInn">>
<<set _regionalCost to ($currentRegion eq "Region1" ? 1 : 1.5)>>
<<set $innStayCost to 50 * _regionalCost>>
<<set $roomAvailable to random(1, 100)>>
<</widget>>
<<widget "restEffect">>
<<set $health to $maxhealth>>
<<set $energy to $maxenergy>>
<<set $gold -= $innStayCost>>
<<set $currentPhase to "🌅 Dawn">>
<</widget>>
<<widget "EraTracker">>
<<set _solarTerms to [
"Start of Spring", "Rain Water", "Insects Awaken", "Spring Equinox",
"Clear and Bright", "Grain Rain", "Start of Summer", "Grain Buds",
"Grain in Ear", "Summer Solstice", "Minor Heat", "Major Heat",
"Start of Autumn", "End of Heat", "White Dew", "Autumn Equinox",
"Cold Dew", "Frost's Descent", "Start of Winter", "Minor Snow",
"Major Snow", "Winter Solstice", "Minor Cold", "Major Cold"
]>>
<<set _zodiacs to [
"🐀 Rat", "🐂 Ox", "🐅 Tiger", "🐇 Rabbit", "🐉 Dragon", "🐍 Snake",
"🐎 Horse", "🐐 Goat", "🐒 Monkey", "🐓 Rooster", "🐕 Dog", "🐖 Pig"
]>>
<<set _eras to [
"Primordial Chaos", "Ascendant Dragon", "Jade Emperor", "Falling Stars",
"Crimson Calamity", "Ten Thousand Swords", "Divine Lotus", "Shattered Heavens",
"Mortal Dust", "Void Spark"
]>>
<<set _timePhases to ["🌅 Dawn", "☀️ Zenith", "🌇 Twilight", "🌙 Midnight"]>>
/* Use Math.floor for display so fractional turns don't cause visual flickering */
<<set _wholeTurns to Math.floor($turns)>>
<<set $currentPhase to _timePhases[Math.floor($turns * (4 / $turnsPerYear)) % 4]>>
<<set $currentTerm to _solarTerms[_wholeTurns % 24]>>
<<set $currentZodiac to _zodiacs[$lifespan % 12]>>
<<set _eraIndex to Math.floor($lifespan / 100) % _eras.length>>
<<set $currentEra to _eras[_eraIndex]>>
<<set $eraYear to ($lifespan % 100) + 1>>
/* Progress as percentage of year, floored to whole percent */
<<set _yearProgress to Math.floor(($turns / $turnsPerYear) * 100)>>
<div class="time-era-section">
<span class="time-era-label">📜 Record of Heavens</span>
<div class="time-era-year">Year $eraYear of the $currentEra Era</div>
<div class="time-era-zodiac">Year of the $currentZodiac</div>
<div class="time-era-season">$currentPhase | $currentTerm</div>
<progress id="year-progress" value="<<print _yearProgress>>" max="100"></progress>
<div class="time-era-cycle"><<print _yearProgress>>% through the year</div>
</div>
<</widget>>
<!-- ═════════════════════════════════════════════════════════════
REALM & POWER MAPPING SYSTEM
Uses the same power scale as player stats
═════════════════════════════════════════════════════════════ -->
<<set setup.powerToRealm = {
0: {realm: "Mortal", stage: ""},
10: {realm: "Body Tempering Realm", stage: "Early"},
11: {realm: "Body Tempering Realm", stage: "Middle"},
12: {realm: "Body Tempering Realm", stage: "Late"},
20: {realm: "Meridian Awakening Realm", stage: "Early"},
21: {realm: "Meridian Awakening Realm", stage: "Middle"},
22: {realm: "Meridian Awakening Realm", stage: "Late"},
30: {realm: "Qi Condensation Realm", stage: "Early"},
31: {realm: "Qi Condensation Realm", stage: "Middle"},
32: {realm: "Qi Condensation Realm", stage: "Late"},
40: {realm: "Foundation Establishment Realm", stage: "Early"},
41: {realm: "Foundation Establishment Realm", stage: "Middle"},
42: {realm: "Foundation Establishment Realm", stage: "Late"},
50: {realm: "Core Formation Realm", stage: "Early"},
51: {realm: "Core Formation Realm", stage: "Middle"},
52: {realm: "Core Formation Realm", stage: "Late"},
60: {realm: "Nascent Soul Realm", stage: "Early"},
61: {realm: "Nascent Soul Realm", stage: "Middle"},
62: {realm: "Nascent Soul Realm", stage: "Late"}
}>>
<<set setup.allPowers = [0, 10, 11, 12, 20, 21, 22, 30, 31, 32, 40, 41, 42, 50, 51, 52, 60, 61, 62]>>
<<widget "getDangerDisplay">>
<<set _danger to $args[0]>>
<<switch _danger>>
<<case 1>>☠️
<<case 2>>☠️☠️
<<case 3>>☠️☠️☠️
<<case 4>>☠️☠️☠️☠️
<<case 5>>☠️☠️☠️☠️☠️
<<default>>
<</switch>>
<</widget>>
<<widget "calculateEnemyPower">>
<<set _dangerLevel to $args[0]>>
/* Fallback check for missing player power matrices */
<<if $power and $power[$cultivationRealm] and $power[$cultivationRealm][$cultivationStage] neq undefined>>
<<set _playerPower to $power[$cultivationRealm][$cultivationStage]>>
<<else>>
<<set _playerPower to 10>> /* Default safely to Early Body Tempering */
<</if>>
<<set _dangerToPowerOffset to { 1: 0, 2: 10, 3: 20, 4: 30, 5: 40 }>>
<<set _offset to _dangerToPowerOffset[_dangerLevel] ?? 10>>
<<set _variationRoll to random(-5, 5)>>
<<set _enemyPower to _playerPower + _offset + _variationRoll>>
<<set _enemyPower to Math.max(0, Math.min(62, _enemyPower))>>
<<set _nearest to _enemyPower>>
<<set _minDist to 999>>
<<for _p range setup.allPowers>>
<<set _dist to Math.abs(_p - _enemyPower)>>
<<if _dist < _minDist>>
<<set _minDist to _dist>>
<<set _nearest to _p>>
<</if>>
<</for>>
<<print _nearest>>
<</widget>>
<<widget "getRealmsFromPower">>
<<set _power to $args[0]>>
<<if setup.powerToRealm[_power]>>
<<set _missionRealm to setup.powerToRealm[_power].realm>>
<<set _missionStage to setup.powerToRealm[_power].stage>>
<<else>>
<<set _missionRealm to "Unknown">>
<<set _missionStage to "">>
<</if>>
<</widget>>
<<widget "calculateActualDanger">>
<<set _base to $args[0]>>
<<set _var to $args[1]>>
<<set _roll to random(-_var, _var)>>
<<set _actual to Math.max(1, Math.min(5, _base + _roll))>>
<<print _actual>>
<</widget>>
<!-- ═════════════════════════════════════════════════════════════
REFRESHMISSIONS WITH CONFIGURABLE MISSION LIMIT
═════════════════════════════════════════════════════════════ -->
<<widget "refreshMissions">>
<<include "SideMissions">>
<!-- Initialize if missing -->
<<if !$allPowers>>
<<set $allPowers = [0, 10, 11, 12, 20, 21, 22, 30, 31, 32, 40, 41, 42, 50, 51, 52, 60, 61, 62]>>
<</if>>
<<if !$powerToRealm>>
<<set $powerToRealm = {
0: {realm: "Mortal", stage: ""},
10: {realm: "Body Tempering Realm", stage: "Early"},
11: {realm: "Body Tempering Realm", stage: "Middle"},
12: {realm: "Body Tempering Realm", stage: "Late"},
20: {realm: "Meridian Awakening Realm", stage: "Early"},
21: {realm: "Meridian Awakening Realm", stage: "Middle"},
22: {realm: "Meridian Awakening Realm", stage: "Late"},
30: {realm: "Qi Condensation Realm", stage: "Early"},
31: {realm: "Qi Condensation Realm", stage: "Middle"},
32: {realm: "Qi Condensation Realm", stage: "Late"},
40: {realm: "Foundation Establishment Realm", stage: "Early"},
41: {realm: "Foundation Establishment Realm", stage: "Middle"},
42: {realm: "Foundation Establishment Realm", stage: "Late"},
50: {realm: "Core Formation Realm", stage: "Early"},
51: {realm: "Core Formation Realm", stage: "Middle"},
52: {realm: "Core Formation Realm", stage: "Late"},
60: {realm: "Nascent Soul Realm", stage: "Early"},
61: {realm: "Nascent Soul Realm", stage: "Middle"},
62: {realm: "Nascent Soul Realm", stage: "Late"}
}>>
<</if>>
<<set _missionArray to []>>
<<set _missionLimit to 0>>
<<if $sidemissions>>
/* TOWN MISSIONS - Show 4 missions */
<<set _missionLimit to 3>>
<<set _pool to $sidemissions.filter(m => m.region === $currentRegion)>>
<<set _missionArray to _pool.sort(() => 0.5 - Math.random())>>
<<elseif $SectSideMissions>>
/* SECT MISSIONS - Show 3 missions */
<<set _missionLimit to 3>>
<<set _currentRankIndex to $sectRanks.indexOf($CurrentPcSectRank)>>
<<set _pool to $SectSideMissions.filter(m => {
if (!m.requiredRank) return true;
return $sectRanks.indexOf(m.requiredRank) <= _currentRankIndex;
})>>
<<set _missionArray to _pool.sort(() => 0.5 - Math.random())>>
<</if>>
/* Process missions - use dynamic limit */
<<set $visibleMissions to []>>
<<for _i to 0; _i < _missionLimit && _i < _missionArray.length; _i++>>
<<set _mission to _missionArray[_i]>>
<!-- Handle different combat statuses -->
<<if _mission.isCombat eq true>>
<!-- KNOWN COMBAT: Calculate danger and enemy -->
<<set _baseDanger to _mission.dangerLevel ?? 2>>
<<set _dangerVariation to 1>>
<<set _dangerRoll to random(-_dangerVariation, _dangerVariation)>>
<<set _mission.actualDangerLevel to Math.max(1, Math.min(5, _baseDanger + _dangerRoll))>>
<!-- Calculate enemy power and realm -->
<<set _playerPower to $power[$cultivationRealm][$cultivationStage]>>
<<set _dangerToPowerOffset to {
1: 0,
2: 10,
3: 20,
4: 30,
5: 40
}>>
<<set _offset to _dangerToPowerOffset[_mission.actualDangerLevel]>>
<<set _variance to random(-5, 5)>>
<<set _enemyPower to _playerPower + _offset + _variance>>
<<set _enemyPower to Math.max(0, Math.min(62, _enemyPower))>>
<!-- Find nearest valid power level -->
<<set _nearest to 10>>
<<set _minDist to 999>>
<<for _p range $allPowers>>
<<set _dist to Math.abs(_p - _enemyPower)>>
<<if _dist < _minDist>>
<<set _minDist to _dist>>
<<set _nearest to _p>>
<</if>>
<</for>>
<!-- Get realm and stage -->
<<getRealmsFromPower _nearest>>
<<set _mission.estimatedPower to _nearest>>
<<set _mission.estimatedRealm to _missionRealm>>
<<set _mission.estimatedStage to _missionStage>>
<<set _mission.enemyRealm to _missionRealm>>
<<set _mission.enemyStage to _missionStage>>
<<elseif _mission.isCombat eq "unknown">>
<!-- UNKNOWN COMBAT: Randomly decide if there's actually an enemy -->
<<set _combatChance to random(1, 100)>>
<!-- 50% chance to have combat, 50% chance to have none -->
<<if _combatChance lte 50>>
<<set _mission.hasUnexpectedCombat to true>>
<!-- Calculate danger (but don't reveal it) -->
<<set _baseDanger to _mission.dangerLevel ?? 2>>
<<set _dangerVariation to 1>>
<<set _dangerRoll to random(-_dangerVariation, _dangerVariation)>>
<<set _mission.actualDangerLevel to Math.max(1, Math.min(5, _baseDanger + _dangerRoll))>>
<!-- Calculate enemy (but don't show it until mission starts) -->
<<set _playerPower to $power[$cultivationRealm][$cultivationStage]>>
<<set _dangerToPowerOffset to {1: 0, 2: 10, 3: 20, 4: 30, 5: 40}>>
<<set _offset to _dangerToPowerOffset[_mission.actualDangerLevel]>>
<<set _variance to random(-5, 5)>>
<<set _enemyPower to _playerPower + _offset + _variance>>
<<set _enemyPower to Math.max(0, Math.min(62, _enemyPower))>>
<<set _nearest to 10>>
<<set _minDist to 999>>
<<for _p range $allPowers>>
<<set _dist to Math.abs(_p - _enemyPower)>>
<<if _dist < _minDist>>
<<set _minDist to _dist>>
<<set _nearest to _p>>
<</if>>
<</for>>
<<getRealmsFromPower _nearest>>
<<set _mission.hiddenEnemyPower to _nearest>>
<<set _mission.hiddenEnemyRealm to _missionRealm>>
<<set _mission.hiddenEnemyStage to _missionStage>>
<<else>>
<<set _mission.hasUnexpectedCombat to false>>
<<set _mission.actualDangerLevel to null>>
<</if>>
<!-- Display as ??? -->
<<set _mission.estimatedRealm to "???">>
<<set _mission.estimatedStage to "???">>
<<set _mission.estimatedPower to null>>
<<else>>
<!-- NOT COMBAT: No enemy, no danger -->
<<set _mission.actualDangerLevel to null>>
<<set _mission.estimatedRealm to null>>
<<set _mission.estimatedStage to null>>
<<set _mission.estimatedPower to null>>
<</if>>
<<set $visibleMissions.push(_mission)>>
<</for>>
/* Reset mission state */
<<set $activeSideMission to null>>
<<set $SideMissionStatus to null>>
<</widget>>
<<widget "PillPavilionRestock">>
<<set $pillpavilionInventory to []>>
<<set $pillpavilionStock to {}>>
<<set _pool to clone($pillpavilionMasterPool)>>
<<set _pickCount to Math.min(8, _pool.length)>>
<<for _pc to 0; _pc lt _pickCount; _pc++>>
<<set _randIndex to random(0, _pool.length - 1)>>
<<set _picked to _pool[_randIndex]>>
<<set _pool.splice(_randIndex, 1)>>
<<set $pillpavilionInventory.push(_picked)>>
<<set $pillpavilionStock[_picked.id] to random(1,4)>>
<</for>>
<</widget>><<widget "gainRandomItem">>
<<set _item = clone(either(...$itemList))>>
<<set _exists = false>>
<<for _i = 0; _i < $playeriteminventory.length; _i++>>
<<if $playeriteminventory[_i].name == _item.name>>
<<set $playeriteminventory[_i].quantity += 1>>
<<set _exists = true>>
<<break>>
<</if>>
<</for>>
<<if not _exists>>
<<set _item.quantity += 1>>
<<set $playeriteminventory.push(_item)>>
<</if>>
<</widget>>
<<widget "AddItemToInventory">>
<<set _found = false>>
<<for _item range $playeriteminventory>>
<<if _item.name == _args[0].name>>
<<set _item.quantity += 1>>
<<set _found = true>>
<</if>>
<</for>>
<<if not _found>>
<<set _newItem = clone(_args[0])>>
<<set _newItem.quantity = 1>>
<<set $playeriteminventory.push(_newItem)>>
<</if>>
<</widget>>
<<widget "craftItem">>
<<set _recipe = _args[0]>>
<<set _canCraft = true>>
<!-- Check to see if enough ingredients -->
<<for _id, _qty range _recipe.ingredients>>
<<set _found = $playeriteminventory.find(function(item) { return item.name == _id })>>
<<if !_found or _found.quantity < _qty>> <!-- If not enough ingredients -->
<<set _canCraft = false>>
<</if>>
<</for>>
<<if _canCraft>>
<!-- Removing ingredients -->
<<for _id, _qty range _recipe.ingredients>>
<<set _item = $playeriteminventory.find(function(item) { return item.name == _id })>>
<<if _item>> <!-- Check to see if item exists -->
<<set _item.quantity -= _qty>>
<<if _item.quantity <= 0>> <!-- If quantity of item is 0, remove it -->
<<set $playeriteminventory = $playeriteminventory.filter(function(item) { return item.name != _id })>>
<</if>>
<</if>>
<</for>>
<!-- Adding result item -->
<<set _existing = $playerpotioninventory.find(function(item) { return item.id == _recipe.result.id })>>
<<if _existing>> <!-- If item already exists, increase quantity -->
<<set _existing.quantity += _recipe.result.quantity>>
<<else>> <!-- If item doesn't exist, create new one -->
<<set _newItem = clone(_recipe.result)>>
<<run $playerpotioninventory.push(_newItem)>>
<</if>>
<!-- Success message -->
<<replace "#craftlog">>You've crafted: <b><<print _recipe.result.name>></b>!<</replace>>
<<else>>
<!-- Message about lack of ingredients -->
<<replace "#craftlog">><span style="color: red;">Not enough ingredients to craft <b><<print _recipe.name>></b>!</span><</replace>>
<</if>>
<</widget>>
basestrength
<<widget "useItem">>\
<<nobr>>
<<if $selectedPotion.quantity gt 0>>
<<set $selectedPotion.quantity to $selectedPotion.quantity - 1>>
/* --- STRENGTH BOOST --- */
<<if $selectedPotion.effect eq "boostStrength">>
<<if $basestrength lt $selectedPotion.maxStatLimit>>
<<set $basestrength to $basestrength + 1>>
<<replace "#use-log">>
<div class="use-log success">
<span class="glow-text">Strength Increased!</span><br>
Your muscles surge with newfound power. Base Strength is now $basestrength.
</div>
<</replace>>
<<else>>
<<replace "#use-log">>
<div class="use-log warning">
Your strength has reached the limit of this pill's efficacy ($selectedPotion.maxStatLimit). No further boost applied.
</div>
<</replace>>
<</if>>
/* --- HEART DEMON NECTAR --- */
<<elseif $selectedPotion.effect eq "raiseCorruption">>
<<set $corruption to ($corruption || 0) + 2>>
<<replace "#use-log">>
<div class="use-log success">
<span class="glow-text demonic">Demonic Essence Absorbed!</span><br>
The sweet nectar burns your throat. Your inhibitions crumble as the Heart Demon whispers in your ear.
Corruption: $corruption.
</div>
<</replace>>
/* --- SUCCUBUS BREATH MIST --- */
<<elseif $selectedPotion.effect eq "boostCharisma">>
<<if $basecharisma lt $selectedPotion.maxStatLimit>>
<<set $basecharisma to $basecharisma + 1>>
<<replace "#use-log">>
<div class="use-log success">
<span class="glow-text">Aura of Seduction!</span><br>
Your voice takes on a rhythmic, hypnotic quality. Others find it harder to look away.
Base Charisma: $basecharisma.
</div>
<</replace>>
<<else>>
<<replace "#use-log">>
<div class="use-log warning">
Your mortal vessel cannot contain more charm; the mist dissipates without effect.
</div>
<</replace>>
<</if>>
/* --- FORBIDDEN YANG SEED --- */
<<elseif $selectedPotion.effect eq "deepCorruption">>
<<set $corruption to ($corruption || 0) + 10>>
<<replace "#use-log">>
<div class="use-log success">
<span class="glow-text demonic">Yang Core Awakening!</span><br>
A violent surge of primal energy explodes in your dantian. Dark patterns flicker under your skin.
Corruption has surged to $corruption.
</div>
<</replace>>
<</if>>
<<else>>
/* --- OUT OF ITEMS --- */
<<replace "#use-log">>
<div class="use-log failure">
<span class="glow-text warning">Meridians remain still...</span><br>
You reach for the pill, but find only an empty jade bottle.
</div>
<</replace>>
<</if>>
<</nobr>>\
<</widget>>
<<widget "LootAfterBattle">>
to-do
<</widget>><<set $playernameList to ["Lianhua", "Meiying", "Ziyan", "Xue'er", "Ruyue", "Yuelian", "Qingxue", "Feiyan", "Huixin", "Ling'er", "Zhilan", "Yunxi", "Shuang", "Yanyan", "Mingyue"]>>
<<set $playersurnameList to ["Bai", "Li", "Feng", "Zhao", "Qin", "Shangguan", "Xu", "Jiang", "Mo", "Yan", "Zhu", "Lan", "Tang", "Luo", "Su"]>>
<<set $internalOptions to ["Selfless", "Upstanding", "Kind", "Wicked", "Selfish", "Evil"]>>
<<set $internalTrait to "">>
<<set $externalOptions to ["Romantic", "Vengeful", "Power-hungry", "Loyal", "Family-oriented", "Carefree", "Glory hound", "Self centered"]>>
<<set $externalTrait to "">>
<<set $NPCinternalOptions to ["Selfless", "Upstanding", "Kind", "Wicked", "Selfish", "Evil"]>>
<<set $NPCexternalOptions to ["Romantic", "Vengeful", "Power-hungry", "Loyal", "Family-oriented", "Carefree", "Glory hound", "Self centered"]>>/* PLAYER TREE (Also patched for safety) */
<<widget "DrawPlayerTree">>
<<set _rel to $playerRelations>>
<div class="scroll-tree player-tree">
<div class="tree-row">
<<if (_rel.masters || []).length gt 0>>
<div class="relation-group">
<div class="relation-label">Master<<if _rel.masters.length gt 1>>s<</if>></div>
<div class="card-container">
<<for _id range _rel.masters>>
<<set _r to $known_npc_list.find(n => n.id === _id) || ($encounterBatch ? $encounterBatch[_id] : null)>>
<<if _r>><<PlayerTreeCard _r>><</if>>
<</for>>
</div>
</div>
<</if>>
<<if (_rel.parents || []).length gt 0>>
<div class="relation-group">
<div class="relation-label">Parents</div>
<div class="card-container">
<<for _id range _rel.parents>>
<<set _r to $known_npc_list.find(n => n.id === _id) || ($encounterBatch ? $encounterBatch[_id] : null)>>
<<if _r>><<PlayerTreeCard _r>><</if>>
<</for>>
</div>
</div>
<</if>>
</div>
<div class="tree-row">
<<if (_rel.exes || []).length gt 0>>
<div class="relation-group">
<div class="relation-label">Exes</div>
<div class="card-container">
<<for _id range _rel.exes>>
<<set _r to $known_npc_list.find(n => n.id === _id) || ($encounterBatch ? $encounterBatch[_id] : null)>>
<<if _r>><<PlayerTreeCard _r>><</if>>
<</for>>
</div>
</div>
<</if>>
<<if (_rel.spouses || []).length gt 0 or (_rel.lovers || []).length gt 0>>
<div class="relation-group">
<div class="relation-label">Partners</div>
<div class="card-container">
<<for _id range (_rel.spouses || [])>>
<<set _r to $known_npc_list.find(n => n.id === _id) || ($encounterBatch ? $encounterBatch[_id] : null)>>
<<if _r>><<PlayerTreeCard _r "Spouse">><</if>>
<</for>>
<<for _id range (_rel.lovers || [])>>
<<set _r to $known_npc_list.find(n => n.id === _id) || ($encounterBatch ? $encounterBatch[_id] : null)>>
<<if _r>><<PlayerTreeCard _r "Lover">><</if>>
<</for>>
</div>
</div>
<</if>>
<div class="npc-mini-card focus player-focus" style="border: 2px solid #ffd700; background: #222;">
<div style="font-weight:bold; color:#ffd700; padding: 5px;">
★ <<if $player and $player.name>><<= $player.name>><<else>>You<</if>> ★
</div>
<div style="font-size:0.75em; color:#ddd;">(Player)</div>
</div>
<<if (_rel.siblings || []).length gt 0>>
<div class="relation-group">
<div class="relation-label">Sibling<<if _rel.siblings.length gt 1>>s<</if>></div>
<div class="card-container">
<<for _id range _rel.siblings>>
<<set _r to $known_npc_list.find(n => n.id === _id) || ($encounterBatch ? $encounterBatch[_id] : null)>>
<<if _r>><<PlayerTreeCard _r>><</if>>
<</for>>
</div>
</div>
<</if>>
<<if (_rel.rivals || []).length gt 0>>
<div class="relation-group">
<div class="relation-label" style="color: #ff4444;">Rivals</div>
<div class="card-container">
<<for _id range _rel.rivals>>
<<set _r to $known_npc_list.find(n => n.id === _id) || ($encounterBatch ? $encounterBatch[_id] : null)>>
<<if _r>><<PlayerTreeCard _r>><</if>>
<</for>>
</div>
</div>
<</if>>
</div>
<div class="tree-row">
<<if (_rel.children || []).length gt 0>>
<div class="relation-group">
<div class="relation-label">Children</div>
<div class="card-container">
<<for _id range _rel.children>>
<<set _r to $known_npc_list.find(n => n.id === _id) || ($encounterBatch ? $encounterBatch[_id] : null)>>
<<if _r>><<PlayerTreeCard _r>><</if>>
<</for>>
</div>
</div>
<</if>>
<<if (_rel.apprentices || []).length gt 0>>
<div class="relation-group">
<div class="relation-label">Apprentice<<if _rel.apprentices.length gt 1>>s<</if>></div>
<div class="card-container">
<<for _id range _rel.apprentices>>
<<set _r to $known_npc_list.find(n => n.id === _id) || ($encounterBatch ? $encounterBatch[_id] : null)>>
<<if _r>><<PlayerTreeCard _r>><</if>>
<</for>>
</div>
</div>
<</if>>
</div>
<<if Object.values(_rel).every(arr => !arr || arr.length === 0)>>
<div style="text-align:center; padding:40px; color:#819ca9; font-style:italic;">
You walk this world alone... for now.
</div>
<</if>>
</div>
<</widget>>
/* Adapted MiniCard specific to the Player Tree */
<<widget "PlayerTreeCard">>
<<set _npc to $args[0]>>
<<set _tag to $args[1]>>
<div @class="'npc-mini-card' + (_npc.isDead ? ' dead-npc' : '')">
<span class="treegrid">@@.link-brown;
<<capture _npc>>
<<link _npc.fullname "RelationsDetailed">>
<<set $selectedNPCid to _npc.id>>
<img @src="'images/' + _npc.enemyregion + '/' + _npc.enemyimage + '.jpg'">
<</link>>
<</capture>>
@@</span>
<<if _tag>>
<div style="font-size: 0.7em; color: #a9819c; margin-top: 2px;"><<= _tag>></div>
<</if>>
</div>
<</widget>>
<<widget "startStatChanges">>
/* Initialize collector for this passage */
<<set $tempStatChanges to []>>
<<set $tempExpGain to 0>>
<<set $tempBreakthroughReady to false>>
<</widget>>
<<widget "gainExp">>
<<set _min to $args[0]>>
<<set _max to $args[1]>>
<<if _max neq undefined>>
<<set _gain to random(_min, _max)>>
<<else>>
<<set _gain to _min>>
<</if>>
<<set _realms = ["Mortal","Body Tempering Realm", "Meridian Awakening Realm", "Qi Condensation Realm", "Foundation Establishment Realm", "Core Formation Realm", "Nascent Soul Realm"]>>
<<set _stages = ["Early", "Middle", "Late"]>>
<<set _realmIndex = _realms.indexOf($cultivationRealm)>>
<<set _stageIndex = _stages.indexOf($cultivationStage)>>
<<set _baseExp = 1000>>
<<set _requiredExp = _baseExp * Math.pow(_realmIndex + 1, 2) * (_stageIndex + 1)>>
/* Apply exp gain */
<<set $exp += _gain>>
/* Store for grouped display */
<<set $tempExpGain += _gain>>
/* Check if breakthrough is possible */
<<if $exp gte _requiredExp>>
<<set $tempBreakthroughReady to true>>
<</if>>
<</widget>>
<<widget "gainStat">>
<<set _mainVar to $args[0]>>
<<set _comp to $args[1]>>
<<set _min to $args[2]>>
<<set _max to $args[3]>>
<<set _cap to $args[4]>>
<<set _label to ($args[5] ? $args[5] : _mainVar)>>
<<if _cap neq undefined and State.variables[_mainVar] gte _cap>>
<<run $tempStatChanges.push({label: _label, amount: 0, type: "capped"})>>
<<else>>
<<if _max neq undefined and _max neq 0>>
<<set _final to random(_min, _max)>>
<<else>>
<<set _final to _min>>
<</if>>
<<set State.variables[_comp] += _final>>
<<StatsUpdater>>
<<run $tempStatChanges.push({label: _label, amount: _final, type: (_final > 0 ? "gain" : "loss")})>>
<</if>>
<</widget>>
<<widget "loseStat">>
<<set _mainVar to $args[0]>>
<<set _comp to $args[1]>>
<<set _min to $args[2]>>
<<set _max to $args[3]>>
<<set _cap to $args[4]>>
<<set _label to ($args[5] ? $args[5] : _mainVar)>>
<<if _cap neq undefined and State.variables[_mainVar] gte _cap>>
<<run $tempStatChanges.push({label: _label, amount: 0, type: "capped"})>>
<<else>>
<<if _max neq undefined and _max neq 0>>
<<set _final to random(_min, _max)>>
<<else>>
<<set _final to _min>>
<</if>>
<<set State.variables[_comp] -= _final>>
<<StatsUpdater>>
<<run $tempStatChanges.push({label: _label, amount: _final, type: "loss"})>>
<</if>>
<</widget>>
<<widget "showStatChanges">>
<div class="stat-changes-container">
/* Show EXP gain if any */
<<if $tempExpGain gt 0>>
<span class="stat-exp">+ $tempExpGain EXP</span>
<<if $tempStatChanges.length gt 0>>
<span class="stat-separator">|</span>
<</if>>
<</if>>
/* Show all stat changes */
<<for _i to 0; _i < $tempStatChanges.length; _i++>>
<<set _change to $tempStatChanges[_i]>>
<<if _change.type eq "gain">>
<span class="stat-gain">+ _change.amount _change.label</span>
<<elseif _change.type eq "loss">>
<span class="stat-loss">- _change.amount _change.label</span>
<<else>>
<span class="stat-capped">_change.label</span>
<</if>>
<<if _i < $tempStatChanges.length - 1>>
<span class="stat-separator">|</span>
<</if>>
<</for>>
</div>
/* Breakthrough notification (separate, more prominent) */
<<if $tempBreakthroughReady>>
<div class="breakthrough-alert">
⚡ **Your cultivation base is trembling. You are ready for a breakthrough!**
</div>
<</if>>
/* Reset for next passage */
<<set $tempStatChanges to []>>
<<set $tempExpGain to 0>>
<<set $tempBreakthroughReady to false>>
<</widget>>
<<widget "StoryRightSidebar">>
<<print $playerX>>
<<print $playerY>>
<</widget>>
<<widget "ReputationAlignmentBar">>
<<set _righteous to $totalPCrighteousreputation>>
<<set _demonic to $totalPCdemonicreputation>>
<<set _total to _righteous + _demonic>>
<<if _total <= 0>>
<<set _alignment to 50>>
<<else>>
<<set _alignment to (_righteous / _total) * 100>>
<</if>>
<<set _evilStrength to 100 - _alignment>>
<<set _goodStrength to _alignment>>
<div class="repAuraContainer">
<div class="repAuraLabels">
<span class="repEvilText">
☠ DEMONIC
</span>
<span class="repGoodText">
☯ RIGHTEOUS
</span>
</div>
<div class="repAuraBar">
<div class="repEvilAura"
style="
opacity: <<= _evilStrength / 100>>;
">
</div>
<div class="repGoodAura"
style="
opacity: <<= _goodStrength / 100>>;
">
</div>
</div>
<div class="repValues">
☠ $totalPCdemonicreputation
<span>
Alignment
</span>
$totalPCrighteousreputation ☯
</div>
</div>
<</widget>>
<<widget "JadeLetterInit">>
<<if ndef $jadeLetters>>
<<set $jadeLetters to []>>
<</if>>
<<if ndef $jadeLetterLastCheck>>
<<set $jadeLetterLastCheck to 0>>
<</if>>
<<if ndef $jadeLetterHookupPending>>
<<set $jadeLetterHookupPending to []>>
<</if>>
<</widget>><<widget "NpcTalk">>
<<if $currentNPC.friendship lt 20 and $currentNPC.talk lt 3>>
<<set _random_desc_1 = $neutralTalkNPC.pluck()>>
_random_desc_1
<<set $neutralTalkNPC to [
"You look like a new face around here.",
"Not many travelers pass through this area.",
"What brings you to this place?",
"Be careful. Not all cultivators are as kind as they appear.",
"The spiritual energy feels dense today, doesn't it?"
]>>
<</if>>
<<if $currentNPC.friendship gte 30 and $currentNPC.friendship lt 70>>
<<set _random_desc_1 = $friendlyTalkNPC.pluck()>>
_random_desc_1
<<set $friendlyTalkNPC to [
"It’s always good to see a friendly face.",
"Training hard again? You never take a break.",
"I found a quiet spot by the waterfall—you’d love it.",
"Let me know if you ever need help with your cultivation.",
"The sect's been talking about your progress. You're not bad."
]>>
<</if>>
<<if $currentNPC.relationshipType eq "lover" and $currentNPC.hadSex eq 1>>
<<set _random_desc_1 = $loverTalkNPC.pluck()>>
_random_desc_1
<<set $loverTalkNPC to [
"I dreamed of you last night…",
"Come closer. I want to feel your presence.",
"You always make my heart feel lighter.",
"After everything, I’m glad we met.",
"When this world turns to chaos, remember you have me."
]>>
<</if>>
<<if $currentNPC.depravity gt 70>>
<<set _random_desc_1 = $highDepravityTalkNPC.pluck()>>
_random_desc_1
<<set $highDepravityTalkNPC to [
"Power is the only language worth speaking.",
"Desire isn't a weakness—it's fuel.",
"Have you ever killed someone and felt… exhilarated?",
"Kindness? That's a lie we tell ourselves.",
"I could show you things you'd never forget… if you're brave enough."
]>>
<</if>>
<<if $currentNPC.mentorshipType eq 1>>
<<set _random_desc_1 = $MentorTalkNPC.pluck()>>
_random_desc_1
<<set $MentorTalkNPC to [
"Your stance is improving. Slightly.",
"Discipline, focus, and patience—that’s the path.",
"Did you review the techniques I assigned?",
"Even a spark can become a flame. Don’t waste your potential.",
"I was once like you… hungry for power, blind to the cost."
]>>
<</if>>
<<if $currentNPC.mentorshipType eq 2>>
<<set _random_desc_1 = $ApprenticeTalkNPC.pluck()>>
_random_desc_1
<<set $ApprenticeTalkNPC to [
"Master, do you think I’m ready for the next realm?",
"I tried the technique you showed me, but something feels off.",
"Thank you for taking me in. I won’t disappoint you.",
"Sometimes I wonder why you chose me.",
"Your teachings… they saved me more than once."
]>>
<</if>>
<<if $currentNPC.relationshipType eq "enemy">>
<<set _random_desc_1 = $enemyTalkNPC.pluck()>>
_random_desc_1
<<set $enemyTalkNPC to [
"Still alive? Disappointing.",
"One day, I’ll surpass you. Count on it.",
"Don’t think I’ve forgotten what you did.",
"You may have power, but you lack honor.",
"Every time we speak, I lose more respect for you."
]>>
<</if>>
<<if $currentNPC.talk gt 10>>
<<set _random_desc_1 = $highTalk.pluck()>>
_random_desc_1
<<set $highTalk to [
"You’ve changed since we first met.",
"Talking to you always makes things clearer.",
"Strange… I never thought I’d trust someone like you.",
"So much has happened, hasn’t it?",
"Even in silence, your presence comforts me."
]>>
<</if>>
<</widget>><<set $playerJuniorSexBeg to [
"Please… touch me. I need it so badly.",
"Don’t tease me anymore… I’ll do anything.",
"I want it—your hands, your mouth—just *please*…",
"Make me yours. I can’t wait anymore…",
"Please, Junior… I’m aching for you.",
"I’ll be good. Just touch me, please.",
"You win… Just don’t stop now.",
"I’m all yours—just take me already.",
"I need you. Right here. Right now."
]>>
<<set $submissiveDialogueNPC to [
"Ah—fuck, you’re so tight, I can barely handle it…",
"Please… don’t stop… I need it, I need all of you—",
"Senior, I’ll do anything—just don’t stop using me like this—",
"Gods, you’re milking me so good… I can’t think—",
"I’ll cum if you keep going like that—please, not yet—",
"Your pussy’s squeezing me so hard—I can’t last like this, fuck…"
]>>
<<set $dominantDialogueNPC to [
"Take it. Every inch—I want you stuffed full of me.",
"You’re dripping for me. You were made for this cock, weren’t you?",
"So needy, so fucking wet—I could do this all day.",
"Look at you. Fucked dumb on just my cock.",
"I’ll ruin you for anyone else—no one will ever fill you like I do.",
"Keep moaning like that and I’ll make you scream my name, slut."
]>>
<<set $neutralDialogueNPC to [
"Gods, you feel incredible… so warm, so tight…",
"Every time I slide in, it’s like the first time.",
"You fit me perfectly—I never want to stop.",
"Your pussy’s so good… I could lose myself in you.",
"I love watching your face when I push inside.",
"You're amazing… fuck, don’t stop clenching like that…"
]>>
<<set $submissiveDialoguePC to [
"Yes—please, keep going, don’t stop—",
"You’re so deep… gods, I can’t take much more—",
"I’m yours—just fuck me however you want—",
"Ah—ah! You’re stretching me so good—",
"Harder—please, just a little more, I can take it—",
"I love it when you take control—use me—"
]>>
<<set $dominantDialoguePC to [
"You like being inside me, don’t you? Pathetic.",
"This pussy owns you now. Say it.",
"You’ll cum when I say so. Not a moment sooner.",
"Beg for it. Beg to stay inside me.",
"Keep moaning—I want to hear how desperate you are.",
"You're lucky I'm letting you fuck me at all."
]>>
<<set $neutralDialoguePC to [
"Yes… right there… gods, that feels so good—",
"Don’t stop, you feel perfect inside me—",
"Deeper… fuck, that’s it—",
"I want to feel every inch… don’t hold back—",
"You’re hitting all the right spots—don’t stop now—",
"So good… I could fuck you like this forever—"
]>>
__________________________________________________________________________________________
_________________________ARROGANT YOUNG MASTER__________________________________
__________________________________________________________________________________________
<<set $vagDoggyArrogantYMdesc = [
"He fucks you hard — hands gripping your hips, teeth at your neck, hips slamming into you with practiced cruelty. Every thrust is punctuated by some mocking praise.",
"His cock drives deep from behind, your ass slapping against his hips with every punishing thrust. He uses you like a toy, panting with pleasure as he dominates you.",
"You feel completely exposed as he takes you from behind, one hand on your neck and the other spanking your ass between thrusts. There's no gentleness — just raw, possessive force.",
"He grabs your hair and pulls you back as he thrusts deeper. Your cries only make him grin harder — you’re being claimed, over and over again.",
"Bent over with your face pressed to the bedding, you can only moan as he ruts into you like a beast in heat. He fucks like he owns you, and in this moment, maybe he does."
]>>
<<set $vagArrogantYMtalks = [
"You moan like a whore.",
"Maybe I’ll keep you here. You’d look perfect leashed beneath my desk.",
"I knew you’d be good on all fours.",
"You're dripping like a bitch in heat. Don't pretend you're not loving this.",
"Say thank you, slut — thank me for fucking you.",
"No one's going to fuck you like this again. I ruin everything I use.",
"You're not even trying to resist anymore. Good. Know your place.",
"Do you like being used by someone above your station?"
]>>
<<set $vagArrogantYMcumCreampie = [
"With a final, brutal thrust, he buries himself deep — your walls clamp around him just as hot spurts of cum flood your pussy. He grunts, grinding in to make sure it all stays inside.",
"He slams in and holds you tight, cock twitching as he fills you. Warm, thick seed spills deep, and he sighs in satisfaction like he just claimed a prize.",
"You feel his cock throb deep inside, and then the hot rush of release. His cum leaks from you almost instantly, but he stays buried, as if daring it to escape.",
"His rhythm falters, then stops — and he groans low as he spills into you. You can feel every pulse, every drop marking you from the inside.",
"He fucks you straight through his climax, pumping cum into you with each lingering thrust. It’s messy, filthy, and he clearly loves it that way."
]>>
<<set $vagArrogantYMcumTalkCreampie = [
"That's where you belong — dripping full of me.",
"Hope you weren’t planning on using that hole for anyone else.",
"Mmm. You feel better wrapped around my cock than anyone else has.",
"I’ll leave it in for a while — wouldn’t want it leaking out too soon.",
"Consider yourself claimed. You’ll be smelling like me for days."
]>>
<<set $ArrogantYMcumMouth = [
"He shoves your head down, groaning as he cums. Hot, bitter seed hits the back of your throat in thick spurts, and he doesn’t let you up until you’ve swallowed every drop.",
"His cock pulses against your tongue as he fills your mouth. You can’t help but gag slightly, but he just grins and tells you to keep going — to take it all.",
"He moans low and steady, holding your head tight as he cums directly into your mouth. You’re left with no choice but to swallow or choke.",
"Warm cum floods your mouth as he finishes, and you can taste every humiliating drop. He pulls out slow and wipes the tip against your lips.",
"He cums hard, and you feel it fill your mouth almost instantly. It drips down your chin as he laughs and wipes the excess across your cheek."
]>>
<<set $vagArrogantYMcumTalkMouth = [
"Swallow it all. Don’t waste a drop.",
"Good whore. Maybe I’ll let you taste it again sometime.",
"You make a decent cumdump, I’ll give you that.",
"Open wider next time. I want to see it pool on your tongue.",
"Keep your mouth open. I’m not done using it."
]>>
<<set $ArrogantYMcumFace = [
"He jerks himself fast, then tilts your chin up — hot ropes of cum splash across your cheeks, lips, and nose. You feel it drip as he smirks.",
"With a low grunt, he strokes out thick spurts that land across your face — some hitting your forehead, others your lips. You’re painted in disgrace.",
"His cock twitches in his grip, then he releases — warm cum hitting your face in wet splashes, some getting in your hair. He looks proud of the mess.",
"You close your eyes just in time. Cum streaks across your face, running down your jaw and onto your collarbone. He chuckles and calls it an improvement.",
"He holds your face steady, aiming every pulse of cum directly onto your features. You're left dripping, sticky, and humiliated — just how he likes it."
]>>
<<set $vagArrogantYMcumTalkFace = [
"Now that’s a good look for you. So fucking pretty like this.",
"Smile for me. Let everyone see how I decorated you.",
"Stay still. I want to admire my work.",
"That’s what your face is good for — catching my cum.",
"Wipe it off? No. Walk around like that. Let them know."
]>>
<<set $vagCowgirlArrogantYMdesc = [
"He pulls you into his lap, your back to his chest, and forces you down onto his cock, letting you ride him like a toy built for his pleasure.",
"His hand cracks down on your ass, sharp and loud, leaving a red mark that stings with each bounce.",
"You feel his cock throb deep inside as he guides your hips, fucking you from beneath while you moan helplessly."
]>>
<<set $vagArrogantYMtalks = [
"Louder. I want everyone outside to hear what a good whore you are.",
"You ride like you've done this before — don't lie to me.",
"That ass will carry my handprint for days. Perfect.",
"I could sit here all night and let you fuck yourself stupid on my cock."
]>>
<<set $analProneArrogantYMdesc = [
"He shoves your face down into the cushion, lifting your hips and exposing your hole before pushing inside slowly, stretching you open inch by inch.",
"Each thrust is hard and deep, his hips smacking against your ass while your moans are muffled in the fabric beneath you.",
"He leans over your back, breathing hotly into your ear as he pounds into your ass like he owns it."
]>>
<<set $analArrogantYMtalks = [
"Face down, ass up — just how I like my pets.",
"You’ll feel this every time you sit, and you’ll remember who did it to you.",
"Even your tight little hole can't resist me.",
"You're nothing but a hole for my pleasure now. Accept it."
]>>
<!-- Alchemy Vendor -->
<<set $azureCauldronChat = [
"The finest elixirs demand the purest flame and the rarest herbs—patience is the true ingredient of immortality.",
"This Qi Gathering Pill was refined under three full moons; one swallow, and your meridians will sing with power.",
"Beware cheap pills from wandering peddlers—their impurities will clog your dantian like mud in a river.",
"A true alchemist does not chase breakthroughs; he coaxes them, gently, like courting a shy spirit beast.",
"Bring me fresh Spirit Ginseng and Crimson Lotus petals, and I shall brew something worthy of your destiny."
]>>
<!-- Weapon Vendor -->
<<set $thunderClapChat = [
"A sword is merely iron until it drinks the blood of its wielder's resolve—choose your blade wisely.",
"This Heavenly Edge was forged in thunder-fire; it hungers for the heavens themselves.",
"Sharpness alone is not enough—a true weapon must resonate with its master's qi, or it is just cold steel.",
"Your stance tells me you favor swift strikes; this Willow-Leaf Saber would dance in your hands like wind through leaves.",
"Bring me the core of a Core Formation beast, and I will reforge your weapon into something legends fear."
]>>
<!-- Shady NSFW Vendor -->
<<set $blissFurnaceChat = [
"Desire is the purest furnace—let it burn away your inhibitions, and your qi will flow freer than ever.",
"A single drop of Phoenix Tears Oil on sensitive skin… and even the sternest cultivator melts into blissful surrender.",
"True dual cultivation begins with trust; relax your body, open your meridians, and let pleasure guide the energy.",
"This jade rod hums with warm yang qi—used properly, it will temper your foundation in ways no ordinary pill ever could.",
"Come to the back when you're ready; Mei Ling's hands know exactly where your tension hides… and how to release it."
]>>
<<set $playerSexLinesCorrupt to [
"Ahh~ Master, harder!",
"Fuck me until I break...",
"Use me like your whore!",
"I'm your cum dump~",
"Fill my slutty hole!",
"Destroy me, please...",
"I need it rough!",
"Make me scream your name!"
]>>
<<set $playerSexLinesNormal to [
"Ahh~",
"Yes—!",
"More... please",
"Harder!",
"Don't stop...",
"Mmmph~",
"Oh heavens...",
"Right there!",
"You're so deep..."
]>>
<<set $playerSexLinesPure to [
"Ah...!",
"It's too much...",
"Be gentle...",
"Mmm...",
"Oh... yes",
"I-I can't...",
"Please be careful...",
"You're... so big"
]>><<set $breakthroughMethod to "">>
Player starts at *Body Tempering Realm* *Early*
<--Body Tempering Realm to Meridian Awakening Realm -->
*Mortal Path*
Items needed : One Earthly Treasure
*Earthly Path*
Items needed : Three Earthly Treasure
*Heavenly Path*
Items needed : 6 Earthly Treasure
<<set $azureserpentscale to {"name": "Azure Serpent Scale", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 150, "tripleprice": 450, "sellprice": 400, "class": "item", "quantity": 0, "description": "A shimmering scale from an ancient serpent that dwells deep in the misty mountains.", "id": "azureserpentscale"}>>
<<set $moonlitorchidnectar to {"name": "Moonlit Orchid Nectar", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 150, "tripleprice": 450, "sellprice": 400, "class": "item", "quantity": 0, "description": "Collected from a rare orchid that blooms only under the full moon’s light", "id": "moonlitorchidnectar"}>>
<<set $emberheartstone to {"name": "Emberheart Stone", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 150, "tripleprice": 450, "sellprice": 400, "class": "item", "quantity": 0, "description": "A fiery gemstone born from volcanic flames, radiating warmth and vitality.", "id": "emberheartstone"}>>
<<set $silentphoenixfeather to {"name": "Silent Phoenix Feather", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 150, "tripleprice": 450, "sellprice": 400, "class": "item", "quantity": 0, "description": "A single feather from the elusive phoenix, symbolizing rebirth and perseverance.", "id": "silentphoenixfeather"}>>
<<set $ghostvineroot to {"name": "Ghostvine Root", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 150, "tripleprice": 450, "sellprice": 400, "class": "item", "quantity": 0, "description": "The twisted root of a plant growing in haunted forests, infused with mysterious energy.", "id": "ghostvineroot"}>>
<<set $celestialdewdrop to {"name": "Celestial Dewdrop", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 150, "tripleprice": 450, "sellprice": 400, "class": "item", "quantity": 0, "description": "A rare drop of dew gathered from the leaves of a divine tree", "id": "celestialdewdrop"}>>
<<set $windqi to {"name": "Wind Qi", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 150, "tripleprice": 450, "sellprice": 400, "class": "item", "quantity": 0, "description": "The essence of the restless wind.", "id": "windqi"}>>
<<set $flameqi to {"name": "Flame Qi", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 150, "tripleprice": 450, "sellprice": 400, "class": "item", "quantity": 0, "description": "The blazing essence of fire.", "id": "flameqi"}>>
<<set $stormqi to {"name": "Storm Qi", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 150, "tripleprice": 450, "sellprice": 400, "class": "item", "quantity": 0, "description": "Charged with the crackling energy of lightning.", "id": "stormqi"}>>
<<set $spiritqi to {"name": "Spirit Qi", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 150, "tripleprice": 450, "sellprice": 400, "class": "item", "quantity": 0, "description": "A pure, refined Qi that heightens awareness and focus.", "id": "spiritqi"}>>
<<set $earthqi to {"name": "Earth Qi", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 150, "tripleprice": 450, "sellprice": 400, "class": "item", "quantity": 0, "description": "The grounding energy of the earth.", "id": "earthqi"}>>
<<set $frostqi to {"name": "Frost Qi", "strength": 0, "agility": 0, "willpower": 0, "armor": 0, "health": 0, "energy": 0, "evadescore": 0, "price": 150, "tripleprice": 450, "sellprice": 400, "class": "item", "quantity": 0, "description": "The frozing essence of ice", "id": "frostqi"}>><<widget "MainMissionStart">>
<<if $mainStageStarted eq "false">>
<<set _chance to (0,100)>>
<<if _chance gt 50>>
As you move through the dense forest on the map, something unusual catches your eye. A faint glow pulses from behind a cluster of ancient rocks nearby.
Do you want to investigate?
<<link "Yes" "MainMissionStart">><<set $pe to 0>><</link>>
<</if>>
<</if>>
<</widget>>
<<widget "MainMissionStage1">>
<</if>>
<</if>>
<</widget>><<if $pe eq 1>>
<<GenerateFamilyBatch>>
<<set _enemy = $encounterBatch[$encounterMainID]>>
<p>A youth smirks at you. He wears the crest of the <b>_enemy.surname Clan</b>.</p>
<<link "Add this arrogant fool and his family to your Book of Connections">>
/* Safely move them from the temporary batch to your permanent list */
<<for _id, _npcObject range $encounterBatch>>
/* Assuming $known_npc_list is an array of objects.
Even better would be making it an Object/Dictionary! */
<<run $known_npc_list.push(_npcObject)>>
<</for>>
<<replace "#result">><span class="gold">Added to your records!</span><</replace>>
<</link>>
<div id="result"></div>
<<link "go back">><<goto "Map|Region1">><</link>>
<</if>>